Kill all internet connections with one button on Mac
Launch System Preferences

Go to &quot;Network&quot; pane and click on &quot;Location&quot; dropdown:




Choose &quot;Edit Locations…&quot; from the dropdown, and then the + in the small window which appears. This will create an &quot;Untitled&quot; location. I recommend renaming it to &quot;Offline&quot; or something similar. Click &quot;Done&quot;



With the &quot;Offline&quot; location now active, select each connection/service in the left column (WiFi, Ethernet, etc). Then click the circle icon at the bottom of the left column and choose &quot;Make Service Inactive&quot; as shown below:



After you have repeated that for each action, click &quot;Apply&quot; at the bottom-right of the window.

Once that is done, you can &quot;kill&quot; all of your network connections by switching to the &quot;Offline&quot; location, and re-enable them by switching back the &quot;Automatic&quot; location (or equivalent).
You can switch to that location by any number of methods. My preferred way would be to use a Keyboard Maestro macro, as Keyboard Maestro has a built-in feature to switch locations, and you can easily bind such a macro to a keyboard shortcut.
You could also do it with a shell script which ran
/usr/sbin/networksetup -switchtolocation 'Offline'
(Replace Offline with whatever you named your location.)
Note that many of /usr/sbin/networksetup's features require sudo but -switchtolocation does not.
To get back online, you would need to run /usr/sbin/networksetup -switchtolocation 'Automatic'
Or whatever your default location is called.
You can also quickly switch locations via &quot;the  menu&quot; which will add a &quot;Locations&quot; sub-menu once there is more than one location defined.