I do see the general concerns of allowing students to leave early; after all, they might meet up with whoever leaves for the bathroom while still taking the exam and provide them with information specific to the exam.
Now, of course that could happen as long as no-one has left, too. Someone could hide information in the bathrooms, or someone could meet up with someone not taking part in the exam at all, or that latter person could hide some information in the bathrooms after the exam has started. These issues could be mitigated in the following cases:
- Only students taking part in the exam can enter the bathrooms. This depends a lot on the architecture; unless the lecture hall is extremely large (> 500 seats maybe, from what I could observe so far in universities?), the average number of required toilets at any moment during lectures generally does not warrant an extra set of bathrooms reserved for a single lecture hall. And even then, those bathrooms seem to be more often than not accessible in a way that one does not have to cross the lecture hall (and thus can enter and leave the bathrooms without anyone in the lecture hall noticing), for the very purpose of allowing outside people to use the bathrooms without disturbing whatever is going on in the lecture hall.
- Students need to be accompanied to the bathroom door. Depending on how many proctors were assigned, and the size of the room/number of students, this may or may not be feasible. And even then, it would not totally prevent the exchange of information to take place in the bathrooms themselves.
- The inside of the bathrooms needs to be checked whenever a student is brought there. This would require to have at least one male and one female proctor around. Highly unlikely to happen in gender-unequal disciplines such as computer science.
Those cases of cheating would be somewhat undirected, anyway. It may depend on the exams, but we generally try to not ask for any knowledge that needs to be memorized (in some cases, notes are even allowed during the exam). Our exams are usually designed in a way to test whether some knowledge can be applied in scenarios that are described on the exam sheets. Hence, the major concern is not cheating by accessing the course material or other references; the major concern is having someone else specifically solve one's particular tasks from the exam at hand. Therefore, what needs to be prevented is the contact between someone who is still taking the exam with someone who also knows the exam tasks. The straightforward solution to this is asking students to wait until everyone has finished.
Another point is that no matter how quiet students try to be, when they get up, they will make at least some noise:
- Walking around creates some noises on non-carpeted floor, so that should generally be minimized. Leaving for the bathroom is allowed as there are medical reasons for that, but there are usually no such reasons that would warrant the impatience of having to leave right away.
- Students who leave need to pack their stuff (writing utensils, drinks/food, other objects they needed to have around such as watches and their student IDs), which again will create some (more than just from writing) sounds.
- In case of "lecture hall" type rooms, that do not have single chairs, but folding seats mounted to the next row of tables, students who do not sit right next to an aisle can only leave by making everyone else between themselves and the aisle get up. It is annoying when that happens in a cinema, and it is downright antisocial to disrupt someone's concentration like that who is taking an exam.
Some students may complain that they are wasting time, and - from an egoistical point of view - they may be right. However, unless we can provide a single room and a single proctor for every single student, that is not how exams realistically work:
- They do not have to stay for an unexpected amount of time. If the exam was scheduled to take place between 2 PM and 4:30 PM, they can expect to leave by 4:30 PM. The time was known beforehand, and they will have arranged their schedule accordingly.
- They are not the only ones taking the exam. Indeed, they (think they) have finished their own exam. But that doesn't mean they can stop caring about their environment at that moment, as the world still isn't centered around them; once they have stopped writing, it is their obligation to allow the other students to finish the exam without any further disruptions. I do not believe in punishing students who take longer by giving them an even harder time. Proctors need to guarantee avoidable disruptions are avoided, and giving in to someone's impatience is definitely avoidable.
- The time is only wasted if they decide to waste it. There are plenty of things to do while waiting in a silent environment; from thinking - to get one's thoughts away from the exam topic - to sleeping. All of those are much less counterproductive with respect to the other students than insisting on creating more noise by leaving immediately.
- Some overhead is to be expected. Reading out the exam rules and checking attendance in the beginning takes quite some time (in large exams, often more than 20 minutes). That is expected when taking an exam, and likewise, students should expect that there will be some time after they have finished writing that they still need to spend in the exam room.
Therefore, my general preference is to simply ask them to wait till the time is over. They can use some of that time to make sure they completed everything correctly (when do you ever get the chance/time to check what you wrote in an exam? You should use that opportunity!), and other than that, they are adults. They should be able to show a little patience on a few occasions.
EDITED to further address some more specific points that were brought up in various of the comments in this thread.