Under a DRI system you disable DRI by quoting out the
Load "dri"line in the
Modulessection in /etc/X11/xorg.conf. After restarting X everything 3D should be slow.
Under an annoying non-standard system (i.e. nVidia) I believe you can link your C program using something like
-lGLMesa. However you are royally screwed if you use something like the Python bindings. Then you would have to do some recompiling/magic relinking to make it all work.