Open and close files manually. It prevents from leaking files, preliminary creation of output files, and accidental closing of stdin and stdout.
Importbench is a set of micro-benchmarks for various import scenarios. It should not be used as an overall benchmark of import performance, but rather an easy way to measure impact of possible code changes. For a real-world benchmark of import, use the normal_startup benchmark from https://github.com/python/performance