Yeah, optimize your code so that instead of echo'ing things, it just defines functions or something.
Another workaround, which is resource wasteful, would be to use [man]ob_start/man to buffer all output, include the file, and use [man]ob_end_clean/man to turn off output buffering and destroy the data that is currently displaying when you try to include the script.