It doesn't really need a shim, if you're parsing incoming data that code should only depend on the endianness of the data, not the endianness of the processor that the code is running on, and in general if you're staying within defined behaviour in C and C++ you're going to need to do this anyway (e.g. https://commandcenter.blogspot.com/2012/04/byte-order-fallac...). If you're concerned about performance optimizers have been able to turn this into the right instructions for decades at this point.