Stop using the `pycompat.open()` shim in most places
See the first comment for what's left. It's worth another pass over these once it lands, because I saw places where files were not closed at all, exception handling wasn't quite correct, and things that could be switched to context managers, and random other things. I'd probably just put them all on default too though to avoid merge conflicts.
Edited by Matt Harbison