People tend to use a finite (compactly supported) window function, which makes it amenable to computation. Without this condition, the Gaussian is indeed the best first choice of window filter. It minimizes Fourier uncertainty, which is the most generic and correct metric absent other conditions.
People like to talk about different window functions having different tradeoffs, since you have to measure the error somehow, and every window function is optimal for a given performance function. That kind of answer is a non-answer, because the default performance function comes from the uncertainty principle, and failing to mention this seems like mathematical negligence. This performance function minimizes time and frequency domain error together.
The other window functions, such as Hann/Hamming/rectangular/triangular, make tradeoffs which are inefficient in this respect. These other window functions should only be chosen when special conditions are known that alter the performance function. For example, if a signal has no time-domain information, the widest possible window should be chosen given the input data, which is the full-length rectangular window. Or if you don't care about frequency-domain information, you can use a sinc window (with all lobes, not just the main lobe as in Lanczos). If your signal only has a single frequency that fades in and out, there's probably some special window function I can't think of. As an example of how windowing choice helps, your ears are more accurate in the combined time-frequency domain than the theoretical optimum predicted by the uncertainty principle. It achieves this by making assumptions on the nature of the signal, and these assumptions tend to hold in nature. Pre-knowledge about your signal can help you tailor your window function beyond the default Fourier uncertainty.
With the compact support condition active, the confined Gaussian becomes the best choice. However, when faced with implementation realities, people tend to not use confined Gaussians, likely because it's hard to compute, in addition to some mild laziness. You can simulate it anyway, by using an extra-wide window, with a truncated Gaussian whose standard deviation is extra small. This reduces truncation to an acceptable level. It will take a little longer to compute though.