TIL that if you don't want your commands to show in history, e.g., you are entering passwords, you can type this command (note that it is preceded by a prompt):
alex@mylaptop$ eval `cat`
then cat reads the command from standard input, and you can hit ^D on the next line to end the command. No matter which shell you are using (bash, zsh, fish) or what your settings are, the command will not be saved in history. Finally, eval does not create a subshell, which is very convenient because any variables you set, changing directory, etc., changes your shell context instead of getting lost.
BTW, if you accidentally get a password stuck in your history, you can use "history" to display the history, "history -d <line>" to delete that line, and "history -w" to make sure that your change gets written.