Move `type_cast_for_write` behavior over to the serialized type object