Default for most accounts I create I use SSH keys, therefore I do not want accounts to have a password set.
Instead of leaving the password blank it is better to disable logging in using a password.
This can be done with the following command:
pw mod user "$USERNAME" -w no
You can check the result with vipw
For example, you will see the following line if we look at the root user:
The asterisk defines that no logins with a password are allowed.
If you want more information about the -w argument be sure to check out the manual of pw(8) to see the other available options.
-w method The -w option selects the default method used to set
passwords for newly created user accounts. method is one
no disable login on newly created accounts
yes force the password to be the account name
none force a blank password
random generate a random password
The `random' or `no' methods are the most secure; in the
former case, pw generates a password and prints it to
stdout, which is suitable when users are issued passwords
rather than being allowed to select their own (possibly
poorly chosen) password. The `no' method requires that the
superuser use passwd(1) to render the account accessible
with a password.