A Python int natively consumes 4 bytes. A pyxb.bindings.datatypes.int instance consumes 362 bytes. This is primarily due to the need to associate per-instance meta information like an xsi:nil setting.
Values that are fundamentally Python primitive types should be stored as instances of those types whenever possible. This should apply to any instance of a simple type that derives from a Python primitive type, whether the instance is content in an element or value for an attribute.
Cases where this will not be possible include:
This optimization will also eliminate association with schema types and elements. The infrastructure that preserves document-order of elements in content is likely to become more complex. All this will have an impact on the speed and correctness of validation.