generate_packets.py: overhaul Variant.get_send() and Variant.get_receive() string formatting
I'll be using this ticket as a smaller metaticket, since the affected code is large enough that it should probably be done in multiple steps.
All sub-issues are now in review. Once they are merged, this ticket will be closed.
Part of #43927. Split from #44575. The get_send() and get_receive() methods of the Variant class do their own formatting thing that needs to be replaced with something more robust. For this reason, they've been left out of a number of recent refactorings, which should also be applied to them once viable.
Steps to be done: