Hi gsimons, and welcome,

Best I can offer is the following:

Eric Partridge, "A Dictionary of Catch Phrases." says this phrase comes from the U.S. and that its probable origin is another phrase, "if it takes a leg!" About the latter phrase, he says " 'Threat of a desperado, in search of revenge' (George P. Burnham, 'Memoirs of the United States Secret Service,' 1872): US underworld: c. 1850-1910. Even at the cost of a leg."

There’s a Brewer’s entry that sounds as if it might have a connection: Chance one’s arm – “To run a risk in the hope of succeeding and obtaining a profit or advantage. The…phrase is of army origin. A non-commissioned officer who offends against service regulations risks demotion and the loss of a stripe from his sleeve.” One can imagine someone saying "I don't care if it costs me my arm AND a leg!"

It does seem to be quite obscure, yet such a commonly used expression.

dxb.