Normally you need a resistor on the input of an opto-isolator to reduce the current flowing through the LED. The PinScape boards have none. Is this because the current is constant current from the TLC5940 and is roughly 8mA (using the 4.02K resistor)?
Right (it's actually more like 10mA - the formula per the data sheet is 39.06/R).
What happens if I connect an output from the KL25Z directly to the opto-isolator? I'm thinking that even though the current is limited from the KL25Z ...
Actually, there isn't any regulation for the KL25Z GPIOs. They're "limited" in the sense that you can't draw more than the limit without frying the whole CPU, but they're not "limited" in the sense that there's some kind of current regulator that will prevent that...
... I need a resistor. Assuming 3.3V output and 1.2V forward voltage, then for 8mA, I would need a 263R resistor. Rounding this up, a 270R would do. Does this sound right?
So yes, you absolutely need a resistor.
The "absolute maximum" in the data sheet for GPIO pin current (source or sink) is 4mA per pin for most of the GPIO outputs. (A few are specially designated for a higher limit.)
As usual with these things, there's also a separate limit on the combined current you can safely draw from all GPIOs in aggregate, and that comes to about 1mA per pin if you happen to have them all on at once. It's not likely that they'll all be on at the same time, but it's not impossible either, so I like to be conservative and try to keep them to about 2mA whenever possible.
So plugging Vs=3.3V, Vf=1.2V, and If=2mA into an LED calculator, I get 1.2K. If you're using this to drive an opto, that's definitely on the low side (the optos data sheets always base everything on If=20mA), but in practice the 817/847 types trigger fine with it. It might not be enough for satisfactory brightness if you're trying to drive an indicator LED, though - for that you might want to add an NPN stage so that you can drive the LED at more like 20mA. If you use any common small signal NPN (2N4401 is cheap and easy to find), you get up order of 100mA with 1mA or less on the base.