Move `type_cast_for_write` behavior over to the serialized type object
Merge pull request #15412 from sgrif/sg-serialized-type-cast-for-write

Move `type_cast_for_write` behavior over to the serialized type object