While there's currently not a way to clear the undo stack as such, it's fairly easy to work around.
Save your painting, then reload it. The undo stack is reset on project loading.
Note though that in ArtRage 2 the undo stack is mostly file-based. So it shouldn't be taking up RAM. But it certainly doesn't hurt to save your work regularly, and occasionally restart ArtRage to reset any memory fragmentation and file fragmentation that may be occurring.
AndyRage's mantra for graphics engine code:
"Sure - how hard can it be?"