Earlier quoted context omitted.
Excluding localhost and some obvious cases where the values are in a local config file still leaves around 111,000: https://github.com/search?p=1&q=filename%3Awp-config.php+DB_...
localhost in the case of Wordpress just means the database is running on the same machine as the web server. Practically every WP instance is set up that way.
Uh, the concept of localhost is not unique to Wordpress in the slightest.