On Teensy 3.x and LC, the old AVR port registers are software emulated (as if Arduino Uno). That allows most very old Arduino code to run without modification.
To get maximum speed software toggling on the LED pin, use this:
Code:
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
while (1) {
digitalWriteFast(13, HIGH);
digitalWriteFast(13, LOW);
digitalWriteFast(13, HIGH);
digitalWriteFast(13, LOW);
digitalWriteFast(13, HIGH);
digitalWriteFast(13, LOW);
digitalWriteFast(13, HIGH);
digitalWriteFast(13, LOW);
digitalWriteFast(13, HIGH);
digitalWriteFast(13, LOW);
digitalWriteFast(13, HIGH);
digitalWriteFast(13, LOW);
}
}
Looping overhead is a major factor in the speed you can get. Here's the waveform Teensy LC creates on pin 13 when running this code.

Hopefully you can see those digitalWriteFast() really do execute in 1 cycle (of 48 MHz), giving a stream of pulses at 24 MHz as the code runs without looping. Then the gaps are from the while() loop. Returning from loop() which runs stuff like serial event checking takes even longer.