This should probably use `str = Type.coerce(str, String, :to_str)` which raises the correct TypeError if the object responds to :to_str, but doesn't return a String object.