This doesn't end up making a huge difference performance-wise on the git man pages (although there is some small speed-up), but may as well go through the native functions where possible. Unfortunately, I couldn't figure out how to keep litprog from eating the str namespace binding. I ended up sticking a nasty bogus attribute, but perhaps there's a better way.
Use exslt str:replace in string.subst when available