https://github.com/numpy/numpy/blob/4b6b29afc06a639975d08f2e95dc3e1c36486188/numpy/core/src/multiarray/iterators.c#L1391 shouldn't be directly comparing to NULL; it should be checking that the kwargs dictionary is len 0 or something like that.