Hi.
This is a fairly big request, but somewhat of a helpful idea for many I'd imagine.
I'm not entirely familiar with how Painter handles displaying the textures in the viewport, so forgive me if this would be completely pointless. But as far as I know, whenever you paint or make changes to a layer which has many layers above, performance will suffer unlike modifying things at the very top of the layer stack.
The idea is, a function that allows you to select and 'bake' a bunch of layers into a single texture/material, so rather than having a whole set of layers, with complex masks with many components (or whatever you refer as to things such as fill, levels, filters...), all these layers will be instead represented by just a small set of textures static textures.
Here's an example. I have a layer in which I want to paint, above are a set of layers with various details that are static, meaning they won't change if I don't touch them. They don't have any anchor points that are outside of the group.
What I've done is I've exported the textures of these layers as masked diffuse, metallic, roughness and normal. I've reimported them and placed them into a fill layer, the result is the exact same as having all those layers.

These layers could go into a 'locked' state, where meaning if you change anything, it will require a rebake or put the layers back into a 'display in realtime' state where they function as normal. Having layers baked would of course mean anything with a anchor point where the anchor point is outside of the baked layers will not update when the anchor point is modified. These baked groups could be automatically rebaked if any of the project maps are rebaked/updated such as curvature or normal.
I can imagine the downsides being increased file sizes, but with the upsides being better performance overall especially when working in lower layers when the artist knows they have a set of layers that will not be modified any time soon.
Another big plus would be, working and especially painting in 4k would be far more manageable by more people if having many layers is slowing their projects down.
If for example you plan to paint on one layer for quite a while, you could take every single layer above and bake them, meaning performance should theoretically be almost as good as painting on an empty project.