My personal preference would be to add not just one "stored encoding size" to the header, but one per data type.  Then we could actually store unpadded 4 byte dof ids, 2 byte subdomain ids, etc. even in cases which need an 8 byte unique id.  That's a significant bit of work, though.