Hi,
If it is not performance-intensive inner loop code, you could use python properties to get and set the bitfields, with C code inside each get and set function to do it properly.
If it is performance intensive, you could implement inline cdef methods for getting and setting.
In both cases, if you have a lot of bitfields it probably makes sense to generate the code from a table (i.e. loop through a python list with metadata about each bitfield and generate the getters and setters).
There might be a better way; this is just what came to mind!
Regards,
Pete