Add a flag when running anonymous apex so that it is treated the same way as a unit test. This would be available from both the developer console and via the api.
Sometimes it would be ideal to just try some code out and know that any DML operations that get performed won't be committed. I wouldn't expect callouts to occur or emails to be sent.
This would also allow individual public test methods from a class to be invoked anonymously. So if one method in a dozen or so is failing you could re-run it and get a more concise log. (Releted Idea: Allow single test method execution from an Apex Class)
I have considered using transaction control and just doing a rollback, but that doesn't give the full advantage of running as a test.