import inspect


def unbind(method):
    """
    Unbinds a bound method.

    :param method:  The method to unbind.
    :return:        The unbound function of the given method,
                    or the method itself if it's not bound.
    """
    if not inspect.ismethod(method):
        return method

    return method.__func__