def METHOD_NAME(
    from_type: typing.Any, to_type: typing.Any
) -> typing.Tuple[bool, typing.Optional[str]]:
    """
    `can_cast_type` is the main API to verify castability
    of one type into another.
    Types can be Python builtins, aliases and subscribed from
    `typing`, as well as arbitrary classes.
    Parameters
    ----------
    from_type : Any
        Origin type.
    to_type: Any
        Destination type.
    Returns
    -------
    Tuple[bool, Optional[str]]
        A 2-tuple whose first element is whether `from_type` can
        cast to `to_type`, and the second element is a reason
        if the first element is `False`.
    """
    # Should this be `if issubclass(from_type, to_type)`
    # Can instances of subclasses always cast to their parents?
    if from_type is to_type:
        return True, None
    can_cast_func = get_can_cast_func(to_type)
    # If this is a dataclass we fetch the datacalss casting logic
    if can_cast_func is None and dataclasses.is_dataclass(to_type):
        can_cast_func = get_can_cast_func(DataclassKey)
    if can_cast_func is None and is_enum(to_type):
        # enum types can register their own handlers, but if they don't
        # we can use the default enum handler
        can_cast_func = get_can_cast_func(Enum)
    if can_cast_func is not None:
        return can_cast_func(from_type, to_type)
    # Default behavior
    if issubclass(from_type, to_type):
        return True, None
    return False, "{} cannot cast to {}".format(from_type, to_type)