Recently I needed to add some new users to many different Drupal 8 / 9 developed sites. Adding more than just one user to each site through the administration ui is a bit time consuming IMO. If you can do something more efficiently that will be reused in the future, take a few minutes extra and do it. Then share it. The Drupal 7 version of this was found on CodeKarate, which has been an invaluable resource for so many Drupalers!
Enough talk, here is the code snippet:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters