Yeah, basically. It's really an anti-burrow...sometimes it's much easier to tell a dwarf where he can't go than where he can. Maybe it'd just be best to implement anti-burrows.
It would depend upon your exact design[1], but Restricted Traffic zones at key points do tend to improve certain pathing options at the cost of spoiling others. Bias this towards helping the regular traffic (such as the almost eternal back-and-forths between quantum garbage-piles and store-rooms set up to receive the de-garbaged items) at the expense of making rarer trips (e.g. between magma workshops and farms, where you have a decent intermediate food processing, storing and consumption points) less efficient to calculate.
But a lot will depend on the layout.
And as NW_Kohaku says (now that I've managed to find a computer outside of work from which to add to my previously rushed post), part of the problem is that there seems basically to be, at present, an equal omniscience of path-knowledge shared around everybody who wants to do anything but random-walk or make other short-term line-of-sight forays. Part of the Improved Pathfinding idea is to perhaps implement a hierarchical/layered pathing matrix so that flyers can utilise air tiles regardless of ground access, (future) burrowers and (also future) wall-scalers/moat-bridgers/barrier-deconstructors can find themselves an intelligent non-standard route without trying to press around impassible or hyper-trapped pathways.
It may also allow for a more realistic amount of sub-omniscience (even fortress-dwellers need to learn routes, and immigrants/traders/invaders/siegers have to explorer, possibly pass on knowledge, and observe where others can (and can't!) travel with impunity) with agent-learning of pathways. At least until Armok makes some strange new reconfiguration they haven't encountered and suddenly it is
not correct to wander up to the base of the magmafall, activate the pressure pad which temporarily shuts it off and then quickly skip along alternate diagonals to avoid it being reactivated before firey starts off down on its own accord due to a hyrdomechanical timer tripping out.
But, to return to the door idea, you know how pets bash themselves against pet-impassable doors (at least until a dwarf wanders through, and they squirrel their way past the barrier (not to mention rabbiting, cowing, cameling, cougaring and now, it appears, pandafying)), without a major overhaul of the pathfinding, all that a particularly dwarf-picky door could probably do is make a dwarf re-compute the path once they encounter the obstacle that is biased against their passage, find almost exactly the same route as before and make this dwarf similarly fret against the portal until some key-holder who is allowed through wanders that way and lets them have a go anyway. If that's their best route.
It it wasn't their best route, then the pathfinding would still explore beyond the door, the dwarf would still realise (after the same amount of pathfinding effort) that they're going somewhere other than through that door, and then set out along that route with no more (or less) effort expended than without the door being barred to them.
I suppose that an initially useful door-locking integration with pathfinding would essentially be the same as using player-defined 'hints' (above and beyond the hints that are Restricted Travel designations, as already discussed), something that is a little frowned upon by those who think there should be a way for the program to automatically work out some shortcuts for the pathfinding algorithm without having to ask the player what he or she wants it to do. So if a door marked "Not for Urist McStonehaulers use!" in the game data is encountered when checking Urist McStonehauler's route, it'd temporarily prune that possible branch. But even then, there are problems in that a certain amount of duplication of the "everydwarf/everyelf/everyFB/everykobold" basic route map would be needed. Or changing the central copy and then 'unpruning' it (either by a form of undo, which is a copy, or re-running the whole pathfinding again to clear out the special case alterations from the cache). Computationally, I foresee slowdowns.
At least that's how I see it. ICVWBW.
[1] As us players often make completely strange design decisions in order to take account of (or, by some estimations, exploit) certain strange game conditions, I don't doubt