StarCraft 2 requires me to enter my password every time I launch the game. Is there a way to bypass this inconvenience, for example by making it remember the password somehow?
No, Starcraft II itself cannot remember your Battle.net password.
It's only illegal if your macro/hotkey scripts are actually performing actions within the game itself.
If you're looking for some tools to automate the launch process, you can look into AutoHotkey or HotkeyNet.
To be more exact, follow the one action, one keystroke rule. Which means that any character action or UI input must be the immediate result of a human pressing a key. So while I can have a single key macro to press multiple hotkeys simultaneously, it would be illegal to make it so that when I press a button, keystrokes would be sent to the game client 5 seconds later. Any sort of "wait" action in your macros are against the ToU. As a multiboxer, I can personally affirm that it is fine to have me press '1' on my keyboard and have all 5 of my shamans cast lightning bolt. It's not fine for me to have a macro that sends 'D' (unload) on a Nydus network every 20 seconds for remote Drone mining.
Once upon a time, there was a way to make World of Warcraft (Blizzard's other giant game) remember your password. You could edit certain files to have your password be filled in automatically.
Blizzard specifically disabled this ability, by removing all ability to change the login screens. They did this in part to prevent spyware/viruses from editing them (to steal your password), and in part because many people play Blizzard games on shared computers in cyber-cafes, where saved passwords could lead to all sorts of mischief.
So, you can't directly save your password for a Blizzard game. At least not until 2027 when you can install ActivisFaceBlizzTwitterBook directly into your cerebral cortex.
Carl's answer mentions some ways to get around this; however, save your password into a macro hotkey program at your own risk.
I suggest that you use a keyboard macro software like AHK to help you :
1) Start SC2 2) Connect to Battle.net 3) Input your password.
It might take you a while to learn AHK or something similar, but if you are a programmer, you will like.
This is now possible using the Battle.net app. This is available to Battle.net account holders in most regions. You can download the app by logging into your account on battle.net, selecting "Games & Codes" and then "Download Game Clients".
After installation, you'll have to log into the app and check the "Keep me logged in" box.
From the app, you can select StarCraft II from the left hand side, choose the region and click "Play". This is assuming you have the game installed, if not you'll have to install it first, which can be done using the app. Or if the game is installed, but the launcher hasn't recognized it, you can tell it the path.
It will load up StarCraft II and will log you into your account automatically.
The app will let you stay logged in for up to 30 days. You'll need to re-enter your login credentials under certain conditions, for example, if you log in with the same account on another computer.
This functionality also works for Diablo III and World of Warcraft.