[mypyc] Add big endian read/write functions to librt.strings (#20772)
This is pretty straightforward -- add big endian variants of existing
functions.
Follow-up to #20757.
I'll add float read/write functions in a follow-up PR.
Also restructure primitive definitions to have more consistent order.
I used coding agent assist to generate the repetitive parts and to
refactor the code and tests.