LIBGL_ALWAYS_INDIRECT. But that does not disable hardware accelerated rendering. And since I'm forgetting the new variable to force software rendering every time I need it I'm going to explain both here.
This variable is used to force an application to always go the indirect rendering path. This means that the libGL (i.e. mesa) does not access the hardware directly but uses the X-servers GLX protocol for the access. The X-server will then use the hardware to render the request.
This variable causes libGL to always use the swrast driver to render the frame in software. This will use no hardware acceleration (i.e. GPU acceleration) at all.
I hope I can finally remember it now :-)
Of course there is another important environment variable:
This variable causes mesa to search in the given directory for DRI drivers. This is handy when doing development since you can have a working driver installed by default and test your driver without breaking your installation.
edit from Corbin Simpson:
Two more useful ones for Radeon people:
RADEON_SOFTPIPE, when set, forces the Gallium Radeon driver into softpipe mode. This makes it quite slow, but it won't ever misrender or die. It even runs glxgears well.
RADEON_NO_TCLfor Gallium or
R300_NO_TCLfor classic r300, will disable HW TCL even if you're not on an IGP chipset. This is useful for testing shaders, and doubly useful on Gallium since HW TCL is very broken there.