While it is a bit of a workaround, and still does not truly remove the content, you may consider deleting any links to the discussion, such as in the syllabus or modules, and hiding the Discussion tab in the course navigation. Students could easily still go to their browser history and go to the direct link to the page, but this could help slow that down.
My other suggestion would be to delete the discussion, and then after the exam, undelete it if needed. Not the same as hiding it, but could be an acceptable workaround if the instructor feels comfortable with it. Lots of concerns with that method though, like if the discussion has any grades associated with it or it was a prereq for continuing through a module.
I'm sure you already thought of these/similar approaches, but just wanted to share how I would approach this knowing the content can't just be unpublished 😊