You actually only need change your user registration options to set notifications to yes, that way all alerts are done on the forum unless the user specifically opts in (adjusts setting) to receive their notifications via email.
Notifications for actions are not spam. Sending out newsletters to members without their consent, that is spam.
The admin feature in the backend to send all members a message, is not really designed to send spam, it is designed to send forum specific administrative notices, ie. rules, legal, upgrade / feature change... something administrative about the forum only. Even that, an admin can untick in the above options "receive site mailings" thus they must opt in. You can also unstick the PC notification.... that way users MUST opt in for any email from your site.
That way if you want to use the ACP mailing function for newsletter purposes or such, everyone being sent to is opt in and you only need include a link back to their account setting page to opt out, by unticking the box that they chose.
A DB query to set everyone to 0 would simply be an alter TABLE VALUE=0 type approach, at a rough guess.