BLD: use unsigned instead of signed for lengths, avoid build warnings
I'm much more confident about the other two BLD PRs (#26757, #26758) than this, largely because:

- [ ] in a couple of comments here I wrote that a certain term should always be non-negative.  I haven't actually confirmed that this is always the case
- [ ] This changed things from int64_t to uint64_t, but could also reasonably have changed them to size_t.  I don't have a compelling reason for the correctness of the uint64_t choice.