import ast


def _parse_input_str(x):
    """Safely parse input dictionary string for load_confound_kwargs
    
    Only permits strings, numbers, tuples, lists, dicts, booleans, and None.
    """
    try:
        return ast.literal_eval(x)
    except ValueError as e:
        raise ValueError("Invalid dictionary string in load_confound_kwargs")