Wrap the return value of the type_id intrinsic in an opaque box

Closes #10594