That's the problem -- that there was a door that could be opened. It seems to me that there shouldn't be. The pilots should have their own separate entrance from the exterior of the aircraft.
I don't mean to come across as condescending, I believe that as long as we spend our time talking about possible "solutions" to what-if, abstract problems, without addressing the real issues, we are just going to waste our time.
Also, we do spend an enormous amount of money on safety in the US. Why do you think the absolute cheapest new cars in the US are two to four times as expensive as new cars in countries that don’t have the same kind of safety standards (e.g. Mexico or India)? And because of the tort system, businesses spend untold amounts of money making their facilities and products safer in general.
It would be a bit distracted to worry about chemical X when there are way more pressing issues on where to shine the limited spotlight of attention. Let those who are concerned with health speak to the spending of precious attention, and let those who are concerned with X discuss the loss of focus on X. Somewhere people will switch sides and a meta conversation will form in terms of resource allocation and framing.
Also, the pilots occasionally need to be able to get back to the cabin for troubleshooting in emergencies and to use the toilet/crew rest.
Toilet, crew rest, and meals can be provided in the pilot's cabin. Troubleshooting may be a good point, but perhaps it would suffice to have a tech in the non-cabin portion of the plane.
In any case, it was just a thought. This is not an issue that I actually have a strong opinion about either way.
I think they have to be able to get in and out to use the bathroom, though. And get some food.