Kristofer Karlsson found that t4205's EXPENSIVE tests run much slower on macOS than on Linux. Most of the time is in tr(1), which on macOS processes input one character at a time through getwchar() and putwchar(). For the more than 2GB t4205 generates, he measured 95 to 123 seconds of CPU time on macOS CI runners versus about 6 seconds on Linux.
The series adds test-tool genbytes and uses it in place of genzeros | tr. In v1 a separate patch renamed test-genzeros.c so the real change appeared as a normal diff, and a third patch folded genzeros into genbytes, with the NUL byte spelled "NUL". Karlsson asked whether that third patch was wanted.
Junio Hamano noted that a 256kB buffer on the stack may be risky given 8MB stack limits on Linux and macOS and about 1MB by default on Windows, though the helper is run-once. He suggested a static buffer. He also said he is indifferent between keeping both helpers and converting genzeros users, and prefers optimizing for those who read history with git log/git show over those reviewing on the list, which argues against a pure-rename-then-modify split.
Johannes Sixt added a discussion of printf as an efficient way to make long byte sequences when the value doesn't matter, which Junio found illuminating, including the platform-specific glitches mentioned.
Karlsson's v2 squashes the rename into the change and removes genzeros by converting its callers to "genbytes 00"; he said he would also accept lowercase hex as input. He noted the file similarity is about 29%, so -M20% would reduce the diff only mildly.