import inspect


def pass_return_value(func):
    """
    Inspect func signature looking for **kwargs.

    If the function defines a variable kwargs parameter named "kwargs",
    then we return True, which means we keep the side-effect origin
    return value in the kwargs. If False  then we strip 'return_value'
    from the kwargs before calling the function.

    """
    spec = inspect.getfullargspec(func)
    return (
        "return_value" in spec.args
        or "return_value" in spec.kwonlyargs
        or spec.varkw == "kwargs"
    )