Actually in Python you could recast (zerocopy) bytearray as other primitive C type or even any other structure using ctypes module.