The link in the first comment to this answer shows the implementation using the overload
decorator. Here is the format of code for this:
@overload
def process(response: None) -> None:
...
@overload
def process(response: int) -> tuple[int, str]:
...
@overload
def process(response: bytes) -> str:
...
def process(response):
<actual implementation>
This format given in the question appears to be consistent with this so would be fine.
A quick note on overloading:
Function overloading is a feature of object oriented programming where two or more functions can have the same name but different parameters.
Python does not support function overloading. When we define multiple functions with the same name, the later one always overrides the prior and thus, in the namespace, there will always be a single entry against each function name.
This link might be helpful.
Python function overloading
The process offerred for overloading that python offers is via the overload decorator in the above way.