There is deliberately no such flag, and understanding why points straight at the right answer.
A password on a command line ends up in your shell history, in the process list where any user on the machine can read it, and often in logs. Every one of those is a place a credential should never be. The client refuses to accept one for that reason, not as an oversight.
The correct solution is public key authentication, which is easier than the workaround and better in every respect:
ssh-keygen -t ed25519to create a key pair if you do not have one. Accept the defaults.ssh-copy-id user@hostto install the public half on the server. This asks for the password once, and only once.ssh user@hostnow connects with no prompt.
That is the whole procedure and it usually needs no server configuration at all. For a script, this is the answer — non-interactive, no secret on any command line, and revocable by deleting one line on the server.