The Windows version of the mongo shell changes the console code page from its initial setting to CP_UTF8 (65001) in order to accomodate UTF-8 output that is not routed through the writeUtf8ToWindowsConsole() function in src/mongo/util/text.cpp.
This code page switching causes a problem if the shell is abnormally exited (segfault or some other abort) because the initial code page is not restored on exit in that case. This leaves the console set to the UTF-8 code page, and other programs (e.g. Python) may complain.
We should remove the code page switching code and let non-ASCII text displayed with, for example, "cout" just display badly (as corrupted text). This may encourage us to remove any remaining code paths that don't go through writeUtf8ToWindowsConsole().
Here's the code: src/mongo/shell/dbshell.cpp lines 1136 to 1154 in the current master branch:
Lines 3 to 6 and 16 through 17 in this excerpt should be removed.