There shouldn't be any power going through a shift cable. Do you have a neutral safety
switch? It would seem that somewhere a positive wire has abraded or something and is making contact with either the outer sheathing of the shift cable, or possibly the inner cable itself, and, as you say, when you clamped it to the boat
you completed a circuit. The cable is most likely ruined, usually there is a plastic inner liner that has probably melted. Test is with a meter to see if the cable is hot (electrically), if so, find out why, fix the electrical
problem and replace the cable.