I'm sure there are more accurate ways but
sudo ls -R / | wc
give you the number of lines returned from the ls command. It's not perfect as there are blank lines in the ls but it's a start.
My desktop machine has about 2.2M files.
Again, there are going to be folks who can tell you how to remove blank lines and other cruft but it's a start.
Only takes a minute to run on my Ryzen 9 5950X. YMMV.