Checking my patch I have two functions that need to
have output params changed to const to avoid casting.
PyOS_strtoul - ptr
PyLong_FromString - pend
This is a no-win situation. If the string is const in the caller, they currently need to cast it. If you make the change, then if string is not const in the caller then they will need to cast it. I've provided a short example below and marked the lines that generate "an incompatible pointer type" warning with gcc.
I suggest following POSIX's lead and omitted the const in these cases.