Same in French.
The expression is in fact "I beat my balls of it" (and not with it), which is built on the same sentence construction as multiple ways of saying you don't care of varying rudeness: I <do something to myself> of it.
The other commonly use verbs that are so French specific they are hard to translate in themselves (foutre, ficher).