Back in 2015 I wrote a script to get all document libraries from all site collections of a web application. I went back to the script to update it a bit. The updates version gets all lists & libraries, searches for all folders and items and gives you a count of folders, items an the size of the site collection.