The transmit side can be done with a really cheap red laser module in a 3D printed adapter. Long ago, I did something like that by hot gluing the laser out of a really cheap laser pointer to the open back of a 3.5mm jack on a sound card. (The laser must be the really cheap kind that's just a diode and resistor - fancy modules with regulation will not work.)
The receive side is considerably more complex and I can't think of anything that would work well while costing less than just buying modules. Many cheaper receivers don't have enough bandwidth to reliably receive 192kHz audio. As an alternative, I have found that transformers salvaged from Ethernet cards work well for isolating S/PDIF over coax or twisted pair.