The function 'reset_peer' in op-mode ipsec.py allows the case of tunnel=None, returning all tunnels for the peer in that case. Consequently, the type hint should be Optional[str], so that the opmode module, respectively, the API schema generation, will translate the argument to have default value None.
Note that the type hint Optional does not //implicitly// have anything to do with default values; it is a simply a shorthand for type Union[..., None], so that type None is allowed by type checking. However, the technique of 'introspection+type_hints' used by the opmode module, respectively, the schema generation functions of the HTTP-API, //explicitly// translates the type hint Optional to provide the default argument '=None'. This allows args of type Optional to be not required for the CLI, and nullable by the API.