I had this exact problem and came to the same conclusion. But for the exam, give them code and ask what it does, or give broken code and ask where the error is. Waaay less marking. I only asked for 3 small functions written by hand and that was still 90% of the effort to mark. But the marks felt valid in the end, so the process seemed to work.