Does localhost or 127.0.0.1 actually send anything to the nearest router or is it all handled internally by the OS?
Meaning, does the driver or something else in the OS stack translate 127.0.0.1 or localhost to an IP for the computer or does it bypass leaving the computer altogether and just get piped back without actually going through the network adapter?
No, it wont leave your network interface.
http://en.wikipedia.org/wiki/Virtual_Interface
Here also an RFC https://www.rfc-editor.org/rfc/rfc3330