I think we are asking the wrong question. I have to assume that the written tests are done on a computer or Grammarly will not be usable. If we are already giving the students the tools (Internet, spell checks), we may want to change the course to be named writing with AI.
It is possible that some students cannot produce anything without AI or a computer. But this is going to the same student that will try to cheat by copying or trying to beat the system.
It is not useful to keep AI out of classrooms because it will only hold back the student. One suggestion would be to make the test multi stage. First, you do the essay as a draft. Without any AI assistance (No wifi). The teacher will then scan the drafts. Drafts need to have minimum word length with no repeat word like etc.
Then let the students use their draft as a base for their essay. One possibility is that AI turns a bad draft around. The other possibility is that AI fails to improve bad work.
The point is that we should embrace AI. Let me give an example of the army. In the past some idiots felt that soldiers should learn to shoot with iron sights even though cheap and durable scopes were already invented. Some countries change to using a scope which hugely improve their soldiers' accuracy. It is true that scope can break in a long war but is it so hard to replace a scope? Ranges had to made longer or the targets got smaller. The fact is that even with penny pinching people, most modern soldiers have a scope on their rifle. It is much cheaper to include a scope than to retrain the replacement.