Closes #22565: fix argument types of PyErr_WarnEx.
Document builtin classes as such, not functions.