Suppose we have a thermodynamic system, and we are capable of doing pressure-volume $(PV)$ work on the system. For a infinitesimal reversible process (where the only type of work done is pressure-volume work), the incremental amount of work done on the system is $\delta W = -P dV$. For an irreversible process of the same type, done slowly enough so that variables like pressure and volume are still easily measurable, the work is now $\delta W = -P_{ext} dV \leq -P dV$, where $P_{ext}$ is the external pressure exerted by the system's environment. Let me know if I'm mistaken about any of this.
In cases like these, and in many other situations, the amount of work done can be easily calculated, as long as pressure and volume measurements have been made on the system during each process. However, I can imagine much more complicated scenarios where it's less obvious how work would be calculated. For example, suppose we have a violent expansion of a gas and a corresponding shrinking of the gas's environment, which is so rapid that the external pressure is no longer uniform across the gas-environment boundary, and where the densities of gas and environment vary so much that volume is hard to measure or even define. (Ok, in this process, maybe we could argue that it occurs so rapidly that no heat exchange occurs, and so the work is just $W= \Delta E$, the change in energy of the system. But suppose I could come up with a better example, where heat flow is possible but quantities like $P$ and $V$ are still ill-defined in this way.)
In such a situation, is thermodynamic work still defined? Even if we can't calculate it directly with a formula like $\delta W = -P_{ext} dV$, I'm wondering if there's a way to get at it indirectly. Or are there certain processes which just don't have a definite value of work, from an operational point of view?