tests: Use Path objects instead of bytes (and update from_disk to support it)
And replace a few instances of open().write(...) which never triggered file closing with Path.write_text(...) so they don't rely on CPython-specific behavior
This complements @marmoute's work in !354 (merged)