encodeLegacyArray = (array, encodePassable) => {
  const chars = ['['];
  for (const element of array) {
    const enc = encodePassable(element);
    for (const c of enc) {
      if (c === '\u0000' || c === '\u0001') {
        chars.push('\u0001');
      }
      chars.push(c);
    }
    chars.push('\u0000');
  }
  return chars.join('');
}
Performs the original array encoding, which escapes all encoded array
elements rather than just strings (`\u0000` as the element terminator and
`\u0001` as the escape prefix for `\u0000` or `\u0001`).
This necessitated an undesirable amount of iteration and expansion; see
https://github.com/endojs/endo/pull/1260#discussion_r960369826

@param {Passable[]} array
@param {(p: Passable) => string} encodePassable
@returns {string}