On current domestic flights the flight door hinges are 2 inches from bathroom hinges. So if there's now the need for two doors (an airlock) will they be lengthening the plane 3 feet to allow for this?
The secondary barrier would have to be between the cabin and the lavatory, so that the pilot can go to from the cockpit to the lavatory on their side of the barrier. So I imagine that whenever the pilot is not about to or actively using the lavatory that barrier would be left open so that passengers can access it.
Some (all?) U.S. domestic airlines currently have this exact system in place, except with a flight attendant standing guard between the first row of seats and the galley/lavatory/cockpit, starting just before the pilot opens the cockpit door. I have no idea if this has been a regulation thing or just a thing I notice the airlines I fly do, but this physical barrier would probably follow the same usage pattern as the current meat-based barrier.
Does it need to be 3 foot multiplied by the width of the plane? Why not a box or cage a bit smaller than a toilet? Hell you could make a retractable person sized cage inside or outside the cockpit.