[3.14] gh-146056: Fix repr() for lists and tuples containing NULLs (GH-146129) (alt) by serhiy-storchaka · Pull Request #146204 · python/cpython
I tried to minimize the diff. If you prefer, we can simply replace PyUnicodeWriter_WriteRepr with _PyUnicodeWriter_WriteReprTrue. This will make future backports more difficult.
We cannot be sure that this is not needed until we analyze every use of PyUnicodeWriter_WriteRepr. This will take a time. Even if it is not needed right now, it can be needed after future backports.