That's not true according to the ATmega datasheet, in section 28 under Electrical Characteristics .....
No you are totally misunderstanding that section of the data sheet.
When a pin is used as an input it has a very high impedance. You can connect it directly to the 5V supply and you will get a negligible current into the pin. The only way you could approach 40mA into the pin is to take the voltage up to several hundred volts by which time you will have over voltaged the pin.
The 40mA applies ONLY to when the pin is an output. The reason the data sheet doesn't specifically say it only applies to the pin as an output is because it is designed for engineers who know there is no way to exceed 40mA when the pin is an input.
than the situation illustrated here
That is when the two pins are both outputs. If one pin was an input that would not damage the arduino.
Ask RuggedCircuits if you don't believe me.