Nikolay, you are mixing up a two things. Your elaborations concern exclusive uninterrupted access, whereas muteces address the issue of interleaved shared access.
Again, there are very few valid use cases in which ANY code (whether in interrupt or task mode does not matter) needs to execute a sequence of instructions without any interference with other code. For these rare use cases, there are ways to prevent interrupts and/or task switches from occurring.
The far more prevalent use case is to serialize access from several strands of execution (ie tasks or interrupts) from accessing the same resource (eg a UART) interleaved. A UART, for example, does normally not care if a sequence of reading from its register set gets interrupted by, say, a QSPI interrupt handler, as long as the peripheral itself is not affected by the interrupt AND the execution of that interrupt is short enough to prevent buffer overruns.