I saw this from Lee Griggs and I wonder if there's anything similar in Cycles: https://docs.arnoldrenderer.com/display/A5NodeRef/clip_geo
I know something similar is possible with the shader nodes: Cycles. Masking objects with shaders (no compositor)
But as you can see, the inside part in the Cycles version looks empty, the geometry is just missing. Whereas in the Arnold version, the geometry is still solid.