Communication between arduinos over 4 interchangeable pins

retrolefty:
If they are randomly mixed up then you are likely to have two output pins wired to together effectively causing a short circuit and pin damage.

I think it ought to be possible to design a discovery procedure to negotiate the identity of the send/receive/ground pins, but this would still leave the possibility that both sides tried to enable the same pin as an output at the same time and drive it to different states during the discovery. Perhaps that could be dealt with by using current-limiting resistors? During normal operation the receiving side would be high impedance so that shouldn't affect the signal drastically.