I'm pretty sure if there is any other way to do it (other than programmatically) then it isn't being discussed on the internets. Line-In gets recommended a lot.
The funny thing is that I didn't even have to Google for it the first time. As soon as I saw Cris asking about audio on Mac OS, Rogue Amoeba came instantly to mind and I immediately went to their site to see if they had any software to accomplish that task.

As I said originally, some versions of Mac OS (definitely in the 9.x days) had a check-box in the sound properties to enable this. I suppose Apple felt it was an application-level preference rather than something you'd set up as a system default and have subsequently retired that property.
Some people have also recommended Mac OS X's "Audio Midi Setup" utility. But reports seem to indicate that the required "Through" check-boxes are now disabled for most people, which I've verified on my own machine.