I like the idea, but just tested your specific example with https://facia.dev/tools/compress-decompress/gzip-compress/
and the second version compresses better, as my intuition already thought, without knowing how gzip works, because you still need a kind of identifier for repeated strings, and how much shorter than 1 byte can they be.