If you need to shake to mix the formula (I hate stirring it) while hot, have the lid a fraction loose, and turn the whole thing upside down whilst tightening it at the same time. You can then shake it upside down without leaks, even when it's hot.
Sounds a bit odd, but I promise it works!