nsmap argument of Element function is of type Optional[_NSMapArg] where _NSMapArg is Mapping[str, str].
But according to the documentation here namespace key for the default namespace supposed to be None:
...
>>> NSMAP = {None : XHTML_NAMESPACE} # the default namespace (no prefix)
>>> xhtml = etree.Element(XHTML + "html", nsmap=NSMAP) # lxml only!
...
So it seems like _NSMapArg should be Mapping[Optional[str], str]