Is it not the type-registry's responsibility to "generate" ids for types?
If so, I would put get_type_id on the registry.