How do I dismiss many multiples of the "Disk Not Ejected Properly" notification in macOS?
Solution 1:
I started killing processes with "Notification" in their name, and when I hit the one called "NotificationCenter" the smoke finally cleared:
killall NotificationCenter
Solution 2:
The Apple Script from "software is fun", with 3 votes at the time of writing, in the suggested duplicate gets rid of all "Disk Not Ejected Properly" notifications on High Sierra (additionally you have to allow Script Editor to control the computer in Accessibility preferences as the post suggests):
tell application "System Events"
tell process "NotificationCenter"
set numwins to (count windows)
repeat with i from numwins to 1 by -1
click button "Close" of window i
end repeat
end tell
end tell