Reconfigure sys.stdout and sys.stderr with backslashreplace error handling at the entrypoint of main() so unwrapping reports and error messages do not fail on Windows consoles configured with non-UTF-8 code pages.