binary (de)serialiazer for more compact PID<->int maps
Python part only for now, the generation on the Java side will follow