(preabmle: the following won't actually give you a working Gmail+Exhange+Mail.app solution, because, as it turns out, m.google.com is not a true Exchange server and is missing some stuff Mail.app expects)
/etc/hosts and map
ns4.google.com to some arbitrary IP:
(might not be needed to do that for all of those but I did and it had an effect)
That way, when you add an account with an e-mail address in the form of
email@example.com, Mail.app will fail to auto-detect that it's Gmail.
It will then complain, but when you press
Continue, you can manually choose the account type to be Exhcange. You then change the server to
m.google.com and add the
@gmail.com suffix to the user name.
Before pressing "Continue" you comment out the
/etc/hosts hack lines. Mail.app then successfully sets up your Gmail account as an Exchange account.
However, as noted in the preamble, it won't work—as soon as you try to sync the mailbox, it'll just try to sync for a long time and then nothing will happen. —I'm just posting it here for those who are curious/like hacking, and in case
m.google.com implements the missing Exchange features at some point and Mail.app doesn't get updated immediately.