Lol everyone was revived by Nagato so Konoha wasn't weakened at all, along with the fact a ninja strong enough to beat Pain is a Konoha ninja that would also put off some countries from attackingFood for thought.
Itachi killed the Uchiha because he was told that the civil war would bring an end to Konoha. The reasoning was that Konoha would be invaded by the other villages because of its weakened state.
Pain destroyed Konoha and killed the majority of its citizens. Orochimaru invaded Konoha and as well and plunged the village into turmoil.
How come it wasn't invaded by any of the other villages?
To me, it sounds like the Uchiha massacre was all for naught.