This can be done by setting the `GIT_CONFIG_GLOBAL` and `GIT_CONFIG_SYSTEM` environment variables to [`os.devnull`](https://docs.python.org/3/library/os.html#os.devnull).