First, beware that the 12 needs to be rolled on the 2d6 for the move, not on the damage dice.
Now that that's out of the way…
This is not the GM's job
The GM doesn't get to decide how or when this move is used.
When you hack and slash, on 12+ deal your damage and choose something physical your target has (a weapon, their position, a limb): they lose it.
No part of the move Smash! tells the GM to decide anything. The move happens when a Hack & Slash move's roll is 12+, and the Barbarian's player chooses what the opponent loses.
Deciding against this isn't the GM's job anyway. The GM's job is to be a fan of the PCs and to make their lives interesting: neither job involves limiting how much smashing the Barbarian does, and following those instructions should mean cheering when the Barbarian does something awesome like this.
Making the moment good is your job
And remember the Principle most relevant to this:
Everything in the world is a target. You’re thinking like an evil overlord: no single life is worth anything and there is nothing sacrosanct. Everything can be put in danger, everything can be destroyed. Nothing you create is ever protected.
So when the Barbarian rolls that 12+, looks you in the eye, and says “I choose the villain's head,” make it happen: let your creation die. The whole point of GMing Dungeon World is to create a world that the PCs can touch and change irrevocably. They've just handed you a golden moment of dramatic climax, so make it good, make it wonderful, be a fan of what the characters have just accomplished, and let them relish their victory.
After all, ending the Big Bad suddenly and with finality, with only cold anger and cold steel, is what the Barbarian does.
Also, that doesn't mean it solves the problem well. Maybe it does! Maybe it doesn't. As always in Dungeon World, a new problem or a complication caused by previous PC actions is always just around the corner, so the Ultimate Villain losing their head may be the end of the game, or can just as easily be the beginning of the next chapter. It doesn't disrupt the game's forward movement, so it's not something to ever worry about, let alone try to prevent.
Aside: A note on “limbs”
Some people can get caught up on the definition of “limb” and whether a head counts as a limb. It's not actually important though, because the list in the move (“a weapon, their position, a limb”) isn't to pick from, it's just a set of examples to give an idea of the possibilities. Yes, a head isn't a limb — but that doesn't matter, because it is valid to choose as “something physical your target has”.