How honest should one be in a PhD exit interview?
I had an exit interview when I left my graduate program and I have also had exit interviews in industry.  My feeling is that exit interviews in Academia have the potential to be productive, whereas in industry, it's mostly just HR covering the company from liability.

There is probably no perfect answer, but I would say that you should be honest while remaining professional and constructive.  If you have criticisms of your degree program, try to keep them general (don't focus on your PI or your lab unless they ask about it).  My program director was very defensive when anyone criticized the program, so I was careful and tried to provide solutions to my criticisms.  I do think that he took some of the suggestions to heart, such as moving the qualifying exam so that it did not overlap with certification board exams.

In my opinion, the exit exam is not the time to bring up anything along the lines of harassment, mostly because I don't think it would be recorded properly, as random_non_bot_person mentioned.

Industry is different.  Exit exams seem to be only there to cover the company.  If you were sexually harassed at the company, HR wants to know so that they can prepare for a legal defense (I'm guessing, I'm no lawyer).  They want to know if you were fired, they want you to understand the implications of any NDAs that you signed, and they want to know that you aren't going to sue them.

Summary: Academia exit interviews have some potential to change the program, but is highly dependent on the program itself.  Industry exit exams will almost definitely not change a thing.