If I were a teacher, I'd give written exams for coding, as we used to have back in the 80's when we didn't have enough dedicated computers for everyone in the class, and most of kids didn't have a home computer to work with. So instead, we'd implement simple algorithms on paper for in-class quiz/tests/homeworks. I remember in high school, we had an exam, and one of the question was to write a for loop counting from 1 to 40. It might be harder to grade, but teacher could usually tell if the code looked good or not. On one occassion, I thought I had written the code correctly but teacher didn't, so I had to demonstrate the code on the computer for the code that I had written in the test and show the teacher that the code ran as expected.
It's kinda like whiteboard coding, but it's a lot less stressful since the test is mostly written on paper without the scrutiny of an interviewer. Obviously, we can't create a react web app, but at least students can demonstrate fundamentals, which are what we should be teaching in the first place.
Another solution would be to create a new programming language that doesn't exist yet for the students to write code for their assignments or perhaps use an obscure language that AI/chatgpt isn't aware of... perhaps we can go back to Ada or Modula 3.