It's somewhat odd that filesystems don't have a call to tell you how many files are in a folder.
Either that call would have to do the same (i.e., walking the files and counting), or you'd need some additional metadata in the directory entry to store how many files there are, requiring additional storage accesses for adding and removing files. Adding to that that both FAT32 and NTFS are quite old and had to run on older hardware. Cycles and disk accesses are not free. On top of that, how often is it necessary to…
This is more-or-less unique to ZFS. Other file systems even on Linux and FreeBSD generally don't provide this behavior.