canonicalize_name is intended to be used to validate input parameters on public API methods and generates warning(s) if has to sanitize things.   I considered adding another utility method for this case but initially thought it wouldn't be very common case, however, in the end there were a lot of core facts that needed this kind of type coercion.