If I am not mistaken, I think there are MIDI guitars
that do this
optically, as well as guitars that are built with Roland pickups
pre-installed. I'm not sure I would want to play an instrument that has
electric current running through the strings! And impoperly wired
normal electric guitar can be a shock hazard as it is!
Bah. Touch a battery. Feel anything? This could be much less
current than that. Yes, you can certainly get shocked by a poorly
grounded sound system, because the strings are connected to the
guitar's "ground". But this wouldn't be any worse for risk.