encodeCompactStringSuffix = str =>
  str.replace(/[\0-!^_]/g, ch => stringEscapes[ch.charCodeAt(0)])
Encodes a string with escape sequences for use in the "compactOrdered" format.

@type {(str: string) => string}