SketchUp does not have geometric layers. (I told you this before.) Besides it is not just the ancestor's geometry, it is the ENTIRE rest of the model except for active context and parent. (You cannot use the "Hide rest of model" feature AND use a heavy-handed hierarchical hide plugin at the same time, as the built-in feature will override and hide the parent context as well.)
The changing the layer pointer property is MUCH more work than toggling the visibility property, because you have to create a hierarchical hash to remember every object's layer property value. (so their layer pointers can be restored.) This means dynamically building a tree structured hash that mirrors the ENTIRE model object tree.
So, toggling the visibility property off is a much better proposition.
However, we are also talking about nested entities collections, which means definitions. Hiding the entities of a definition, hides them in ALL instances in the model. If there is more than one instance of the "parent", you will not be able hide any of them via the API, leading to confusion.
I agree with Julia here display helpers should not modify the model. Doing so has ramifications with AutoSave and backup files, the undo stack etc.
Ya'all need to remember here that the end user will have multiple nested editing contexts open, so wrapping property changes in an undo operation and aborting is out of the question, for a workaround implementation.
This would need to be a native feature implemented on the C/C++ side in the render pipeline.
So, we are back to the original feature request
(1) How would the Model Info > Components panel need to change to make such a feature usable without being confusing ?
(2) Would some type of keyboard shortcut be wanted to toggle grandparent and parent visibility "on the fly" ?