While these warnings point to real errors in the code, PyMethodDef are an exception where functions with different numbers of arguments are all cast to the same function type.