Putting a level 10 character against a level 2 party is essentially a "rocks fall and everyone dies" since it matters very little what the party does – one round kills a character regardless.
Instead forecast the difficulty and offer your party ways to atone.
As an example one of my early campaigns had the party commit a few crimes outside of plain view, but they carried the evidence for all to see (the warlock wore a missing merchant's ring, the barbarian slung the murdered knights great sword across his back, the cleric even wore his armour).
It didn't take long before they found themselves in an eerily empty town square – citizens had been evacuated and the guard began to block the exits and cover the rooftops. The captain came out to negotiate their surrender – the party had done some good in the town and may only be opportunist looters.
I put overwhelming numbers in, anyone who knows the game can see when action economy means things will not go your way. A fighter they've never had the measure of before won't give the same warning.
Your mileage on punishment may vary but death is, generally, a pretty boring and agency removing option. What fits best really depends on your campaign, but this way you've forecasted death to your party (if they don't seem aware just tell them) and by fighting they've chosen to go down in a blaze of (questionable) glory rather than negotiate. Put the choice in your player's hands.