[docs] [issue25912] Use __spec__.__name__ instead of __name__ in the docs where appropriate