On one line

All the way through to pin 10. Can it be done?

How about this?

pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); ...., pinMode(10, OUTPUT);

If those pins are all on the same port, you can ever do it with one statement.