+1 for this being a potentially useful future. We've run into this when trying to write type stubs for certain TensorFlow operations in
https://github.com/deepmind/tensor_annotations - as a concrete example:
```python
# reduce_sum has a signature (input_tensor, axis=..., keepdims=..., name=...)
# But when keepdims=True, because the result is always the same rank
# as `input_tensor`, we don't care about the `axis` argument:
@overload
def reduce_sum(input_tensor: Tensor2[A1, A2],
axis=...,
keepdims: Literal[True],
name=...) -> Tensor2[A1, A2]: ...
@overload
def reduce_sum(input_tensor: Tensor3[A1, A2, A3],
axis=...,
keepdims: Literal[True],
name=...) -> Tensor3[A1, A2, A3]: ...
```