unexpected input from serialEventRun()

You don't even need to define your own main(), you can just define your own serialEventRun() in the sketch. Since it's weakly defined in the core, your definition in the sketch will override the default definition:

void serialEventRun() {}

void setup() {
}

void loop() {
}

It saves a little memory and makes the loop() run a little faster too!

serialEventRun() is only used for the serialEvent() function, which is not really that useful:

As long as you weren't using serialEvent() in your sketch, it will cause no problems to override serialEventRun().