Safety is a feature and that null check prevents bugs. I'd rather have slow but safe code rather than fast but buggy code.
IMO, even though this is C, the Zen of Python still applies, which states:
> Errors should never pass silently unless explicitly silenced.
Its the caller with the bug, not the library code.
Then the type of the function would just declare a that the pointer can't be null, and code which sends a nullable pointer would refuse to compile.
"Premature optimization.... " you get the drift.