Introducing gmail.py, a Python script that can log into a Gmail inbox and export messages as raw e-mail source, suitable for backup and import into other e-mail programs. It doubles as a Python interface to Gmail, so you can interact with your inbox from the Python command line (on a limited, read-only basis).
The product of a few nights' coding as a mental exercise, it's in its very early stages, but it seems to work for me. I haven't decided yet whether I want to take this on as a project or leave it as is. As it stands, you need to know Python to use it. Please let me know whether you're interested in seeing this go further.
I suspect this script will become obsolete as soon as Gmail starts offering export features of its own, but it's useful for backup purposes for now.