How is `git_buf_printf` heavyweight?  You're stuffing the results right into that anyway.

If you're worried about weight, then just make this part of the call to `git_buf_printf` in the first place.