bpo-45831: _Py_DumpASCII() uses a single write() call if possible (GH-29596) (GH-29598)

If the string is ASCII only and doesn't need to escape characters,
write the whole string with a single write() syscall.
(cherry picked from commit b919d8105c4d77f00509b6d3ab2073f09db640de)

Co-authored-by: Victor Stinner <vstinner@python.org>
2 files changed