From your example:
def foo(
hello: str="world", bar: str=None,
another_string_or_None: str|????=None):
...
I’ve noticed that your use case is “something or None”.
Since version 3.5, Python supports type annotations via typing module.
And in your case, the recommended way of annotating is by using typing.Optional[something] hint. This has exact meaning you’re looking for.
Therefore the hint for another_string_or_None would be:
import typing
def foo(
hello: str="world", bar: str=None,
another_string_or_None: typing.Optional[str]=None):
...