def lowercase_dict(d: dict, values=False):
    """convert all keys and values (if values=True) in d to lowercase (obviously str-only)"""
    new = {}
    for k, v in d.items():
        if not values:
            new[k.lower()] = v
            continue
        try:
            new[k.lower()] = v.lower()
        except:
            new[k.lower()] = v
    return new