Edited here on the web - copied to local machine and it built as tested : https://forum.pjrc.com/threads/54711-Teensy-4-0-First-Beta-Test?p=209959&viewfull=1#post209959
Proposed add locations for startup_early_hook(); and startup_late_hook(); just before two existing waiting while()'s.
With debug 'PRINT_DEBUG_STUFF' disabled the three T4B2's here hit the EARLY code about 1.2 ms and LATE at about 45.3 ms after the systick is started.
Where the current printf_debug_init() call is might be critical at some point adjust 'something' as you did enabling the Serial4 port for debug - before clocks and other things are started perhaps startup_reset_hook()
Add quick test at start of function to return if there are no events pending.
Do this before checking if in ISR and the like. Cut timing down a lot in yield.
Put in probably temporary bandaids to allow code that uses:
Serial.readBytes(Buffer, cnt);
To function. It simply loops calling the underlying code for Serial.read().
Comment out some of the main programs debug print statements plus add yield call to main loop.
yield can now call SerialEvent.
Put hack in that if the user has not overwritten the SerialEvent function, the weak linked one will turn off calling itself...
Fixed the Serial2 object to use the new correct pins, plus made Serial8 only valid for T4 B1 (not B2).
Also I defined IO pins for the six signals associated with the SD Card slot.
I have tested these both as IO pins and now as SPI2