Well, the US sort of faced the situation that you were describing (fighting an enemy that killed six to ten million people in four years) and then passed a law similar to what you are describing. Have a a look at the Sedition act of 1918.
In hindsight it was a terrible idea, and was repealed in 1920.
In hindsight it was a terrible idea, and was repealed in 1920.
https://www.mtsu.edu/first-amendment/article/1239/sedition-a...