Exactly. The circumstances even conspired in Kirk's favor there: his ship only had 20 people aboard, all apparently free to move around, so he could quite possibly destroy some 90 % of the Enterprise
in the process of liberating her from M-5, without casualties.
Things would have been different had M-5 been in a position to take hostages. But Kirk still had only 20 of those, against the three times more deaths on the other ships already; suicide would certainly have been a viable tactical move there.
It would make perfect sense for the primary off switch to fail (it even appeared to be Daystrom hardware rather than something Scotty would personally have built and approved), and for the heroes to struggle with that for a few moments. But the secondary, tertiary and however you latinize umpteenth shutdown methods should certainly have been available after a short assessment of the situation.