Use generics to allow Type::set_names to accept any ToCStr implementor
Remove unnecessary unsafe blocks