Those APIs are used by pickle and provide a great way to handle escaped bytes sequences in much the same way as str(bytes)/repr(bytes) works. In Python 2, these were used by the `string_escape` codec, but that was removed for some reason. Perhaps we should revive this as `bytes_escape` codec. Example: `codecs.escape_decode(str(b))[0][2:-1] == b` <!-- gh-linked-prs --> ### Linked PRs * gh-136310 * gh-136314 <!-- /gh-linked-prs -->