With some simple garbage collection, I've now gotten it to keep memory use steady at under 900 MB. Which has the additional benefit of speeding up the actual committing phase (from ~1.6 commits/s to ~3.9 commits/s on my machine). Committing the entirety of Pike thus goes from ~10.7 hours to ~4.4 hours (much better, but still quite a bit too long though...).
By rewriting the script to use git fast-import instead, it's now chugging along nicely at ~12.5 commits/s (ie ~47 minutes).