def get_int(val):
    """Cast a value as an integer or a float if not an integer, if possible.
    
    Args:
        val: Value to cast. If a tuple or list, each entry will be casted 
            recursively.
    
    Returns:
        Value casted to int, falling back to a float, None if ``none``
        (case-insensitive), or the original value if any error occurs during
        casting.
    """
    if isinstance(val, (tuple, list)):
        return [get_int(elt) for elt in val]
    try:
        # prioritize casting to int before float if possible
        return int(val)
    except ValueError:
        try:
            # strings of floating point numbers will give an error when casting 
            # to int, so try casting to float
            return float(val)
        except ValueError:
            if isinstance(val, str) and val.lower() == "none":
                # convert to None if string is "none" (case-insensitive)
                return None
            return val