goptlib double-escapes with backslashes
The escape function is meant to prevent problematic bytes (specifically \x00 and \x0a) from being emitted in a PT→Tor output line. Because, according to pt-spec.txt,
<ArgChar> ::= <any US-ASCII character but NUL or NL>
However, the way the function does escaping (prepending with backslashes) conflicts with the established use of backslash to escape SMETHOD ARGS. As noted in comment:1:ticket:12930, any string that needs escaping in SMETHOD args, like a base64 string that ends with '=', is getting double-escaped.