22
The hack is via a :cmap or :cabb, but these have side effects (i.e. other instances will be inadvertently converted, too).
The cmdalias plugin does this better.
But I think for your use case it's best to define your own uppercase command-variants. The main challenge is to support all the options that the original one has:
command! -bang -range=% -complete=file -nargs=* W <line1>,<line2>write<bang> <args>
command! -bang Q quit<bang>