Well, if you're bad you'll get punched in the head.
If you're good you'll punch him, and hurt your hands.
Either way......................
I saw a weird karate match once. It was called kyokushinkaikan or something like that. They really hammered on each other, but were only allowed to punch to the body, so they didn't hurt either their hands or head. Might be a solution. (Yeah, they kicked too. But who cares if you hurt your toes.)
I did karate years ago. I got slight injuries on my hands several times but I was not at that moment playing anything regularly.
Still, at those times, I couldn't play for about a whole month. Twisted fingers last for a lot, at least for me and they're very easy to happen. One of the worst times was when I punched a colleague directly fist to fist. hurst, believe me, and your fingers have to stop for some time.
This might be something you want to consider.
Plus, I read in a karate book about a specific exercise to the hands: you had to dip your hands outstretched into a bucket full of sand. I don't remember the objective, but the book warned that if you were a musician you should not do it because it would destroy your sensitivity.
I don't know anything about boxing. You use gloves and all so your hands may be protected, but if I were training piano seriously, I would not do karate for the above reasons. The change of you having to stay for long periods without playing is very great.
Alex