MAINT: In loadtxt, refactor detection of the number of columns. (#19616)
MAINT: In loadtxt, refactor detection of the number of columns. (#19616)

`for... else...` seems more idiomatic than manual iteration and catching
StopIteration.
Also rename the slightly cryptic `N` to a clearer `ncols`.
jakirkham/numpy,mattip/numpy,simongibbons/numpy,simongibbons/numpy,simongibbons/numpy,pdebuyl/numpy,numpy/numpy,rgommers/numpy,simongibbons/numpy,mattip/numpy,pdebuyl/numpy,charris/numpy,numpy/numpy,anntzer/numpy,jakirkham/numpy,numpy/numpy,jakirkham/numpy,seberg/numpy,endolith/numpy,mhvk/numpy,mhvk/numpy,charris/numpy,charris/numpy,anntzer/numpy,endolith/numpy,pdebuyl/numpy,jakirkham/numpy,simongibbons/numpy,charris/numpy,rgommers/numpy,seberg/numpy,endolith/numpy,numpy/numpy,rgommers/numpy,mhvk/numpy,mhvk/numpy,rgommers/numpy,seberg/numpy,jakirkham/numpy,anntzer/numpy,mattip/numpy,anntzer/numpy,seberg/numpy,mattip/numpy,pdebuyl/numpy,endolith/numpy,mhvk/numpy