Instead of relying on address of a static template variable (which is not dynamic modules friendly), switch to Nunavut generated full type name string (python code already has it), from which could generate a hash per template instantiation, and use it as type id.
Instead of relying on address of a static template variable (which is not dynamic modules friendly), switch to Nunavut generated full type name string (python code already has it), from which could generate a hash per template instantiation, and use it as type id.