I think you're asking for support for the core.compression, core.packCompression and core.looseCompression settings in Dulwich. I think that would be great to add.
A pull request to add support for these configuration would be great; I think you would want to:
* Add arguments to ObjectStore() for loose_compression_level and pack_compression_level
* Add support for compression_level in as_legacy_object()
* Pass the appropriate compression_level arguments to as_legacy_object in ObjectStore
* Update Repo to retrieve the three configuration variables and pass loose_compress_level and pack_compression_level to ObjectStore, defaulting to core.compression.
Otherwise, if you create an issue on GitHub I can probably add it some point this month.
Cheers,
Jelmer