bazel syntax: eliminate unnecessary array copying

Before, EvalUtils.toCollection would return a view (if given a Sequence)
but a copy if given a Dict. This makes it inefficient and also hard to reason
about. This change replaces it with Starlark.toIterable and Starlark.toArray:
the first always returns a view, the second a copy.

Also:
- CallUtils: eliminate array copying in handling of *args and **kwargs.
- Start removing Location parameters from everything we touch.
  Location is automatically added to EvalExceptions by the interpreter.
- MethodLibrary: eliminate array copies in
  sorted, reverse, tuple, list, enumerate.
- Also in string.join, string.partition. Simplify the latter function.
- Improve text of an error message.
- Declare Starlark.len, which returns the length of a string or iterable.

This change removes support for Starlark Map other than Dict, because
there are none today.

PiperOrigin-RevId: 282682290
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
index 7e938ef..13bb23a 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/SkylarkEvaluationTest.java
@@ -1508,11 +1508,11 @@
   @Test
   public void testSetIsNotIterable() throws Exception {
     new SkylarkTest()
-        .testIfErrorContains("not a collection", "list(depset(['a', 'b']))")
+        .testIfErrorContains("not iterable", "list(depset(['a', 'b']))")
         .testIfErrorContains("not iterable", "max(depset([1, 2, 3]))")
         .testIfErrorContains("not iterable", "1 in depset([1, 2, 3])")
-        .testIfErrorContains("not a collection", "sorted(depset(['a', 'b']))")
-        .testIfErrorContains("not a collection", "tuple(depset(['a', 'b']))")
+        .testIfErrorContains("not iterable", "sorted(depset(['a', 'b']))")
+        .testIfErrorContains("not iterable", "tuple(depset(['a', 'b']))")
         .testIfErrorContains("not iterable", "[x for x in depset()]")
         .testIfErrorContains("not iterable", "len(depset(['a']))");
   }
@@ -2035,9 +2035,7 @@
 
     new SkylarkTest()
         .testIfErrorContains(
-            "type 'int' is not a collection",
-            "def bar (): return [x + y for x, y in (1, 2)]",
-            "bar()");
+            "type 'int' is not iterable", "def bar (): return [x + y for x, y in (1, 2)]", "bar()");
 
     new SkylarkTest()
         .testIfErrorContains(
@@ -2046,7 +2044,7 @@
             "[x + y for x, y, z in [(1, 2), (3, 4)]]");
 
     new SkylarkTest()
-        .testIfErrorContains("type 'int' is not a collection", "[x2 + y2 for x2, y2 in (1, 2)]");
+        .testIfErrorContains("type 'int' is not iterable", "[x2 + y2 for x2, y2 in (1, 2)]");
 
     new SkylarkTest()
         // returns [2] in Python, it's an error in Skylark