Why is there a limitation in using Serial.println on ESP8266?
It's happening because you're not giving the ESP8266 a chance to do its housekeeping activities and the watchdog (which is enabled by default) is timing out - as evidenced by the very first line of your output:


  Soft WDT reset 


You need to allow the MCU to do other things at the same time as you are printing to serial:

void foo(){
    for(unsigned int i = 1; i &lt;= 10000; i++){
        Serial.println("FOOBAR");
        yield();
    }
}