The best extinguisher for this type of fire would have been a BCF (vapourising liquid/Halon) extinguisher (container used to be green).
Sadly, these were banned a couple of years ago since halon is a CFC - I suppose there's more halon in an extinguisher than in a can of hairspray (sic).
My fav way always the
carbon tetrachloride extinguisher.

Not only famous for killing fires - it would most likely give you cancer and/or liver failure with
prolonged exposure - leading to death, naturally. They were banned many moons ago. Never forget the smell of those things
Now you'll just have to make do with a class BC/ABC class powder extinguisher and make a mess of your house (if you are at home).
That said. Electronic parts stink when they are about to erupt (as we all know). I don't have a laptop, so I can't imagine how difficult it would be, but, surely its possible to yank-out the pack and throw it somewhere (safe that it).
.