def nullable_multi_callback(null="null"):
    """
    A callback which converts multiple=True options as follows:
    - empty results, [] => None
    - [<null>,] => []
    - anything else => passthrough

    This makes the null value explicit, and not setting it results in omission, not
    clearing.

    The null value used here is tunable. If set to a non-string value when using a
    string type, like `None`, it means that "there is no null value" because
    there is no way to pass `[]`

    Note that this will see values after the type conversion has happened.
    """

    def callback(ctx, param, value):
        if value is None or len(value) == 0:
            return None
        if len(value) == 1 and value[0] == null:
            return []
        return value

    return callback