Connecting two development boards together

I have two development boards, both by Terasic. I have a DE1-SoC and an Apollo S10 SOM. Each board has a 2x20 pin header. I want to interface both boards by the GPIO header pins.
ive read that some people will tie both grounds together, but doesn’t this just create a ground loop? Each board has different power supplies. The DE1-SoC has a 12v, 1.2 A supply, the Apollo is 12v, 20 A, and there both referenced down to 2.5 LVTTL compatible via header pins.
For obvious reasons, I’d truly dread even remotely damaging the Apollo board, very expensive.
Is there a safe way to connecting both without having to resort to opto-couplers ? And there is no way of powering the DE1-SoC from the Apollo board supply, as it can use almost the full potential of that power supply, or is board limited via kill switch which triggers a powerdown procedure.

A ground loop in normal gear connections can pick-up noise and make signals inaccurate but I’ve never heard of one causing circuits to fail permanently.