The Python handler supports extensions through mkdocstrings' handler extensions.
Specifically, additional templates can be added to the handler,
and Griffe extensions can instruct the handler to use a particular template
for a particular object by setting a value in the Griffe object's extra dictionary:
obj = ... # get a reference to a Griffe object
if "mkdocstrings" not in obj.extra:
obj.extra["mkdocstrings"] = {}
obj.extra["mkdocstrings"]["template"] = "template_name.html"