PyArray_Pack is a more general API than PyArray_SETITEM, since the latter doesn't support casts. There's also a publicly visible comment in ndarraytypes.h that PyArray_Pack should be preferred for cases where a cast is needed, but it's not publicly exposed. We should expose it publicly.
See e.g. #21014 (comment).