import string


def to_constant(s: str) -> str:
    """Returns a new str in CONSTANT_CASE, given any str.

    Examples:
        >>> to_constant('to_constant')
        'TO_CONSTANT'
        >>> to_constant('Meals, Entrees, and Side Dishes')
        'MEALS_ENTREES_AND_SIDE_DISHES'
        >>> to_constant('American Indian/Alaska Native Foods')
        'AMERICAN_INDIANALASKA_NATIVE_FOODS'
    """
    s = s.replace(' ', '_')
    s = ''.join(c.upper() for c in s if c in string.ascii_letters or c in '_')
    assert s.isidentifier(), s
    return s