import numbers


def is_scalar_zero(expr):
    """
    Utility function to test if an expression evaluates to a constant scalar zero
    """
    if expr.is_constant():
        result = expr.evaluate_ignoring_errors(t=None)
        return isinstance(result, numbers.Number) and result == 0
    else:
        return False