There's two separate, possibly related issues
**kwargs is not getting expanded in the generated signature as expected all the time
- When an explicit keyword is given such as
currentNamespace in "(currentNamespace: Literal[True], **kwargs) -> str", the expanded signature lists currentNamespace twice, which is an invalid signature
Note: This ticket is a followup from 5dafefd. See the TODO note in that code for an example.