It is a quirk of Blender's current UI, but actually you can deduce its location a bit, helped by Blender's API documentation.
The property you're looking for is
SpaceView3D.show_grease_pencil, that one is clear. Now, what class contains a
SpaceView3D's ancestor)? Scroll down to References section in that class' docs. One of references there leads to
Area.spaces. This is easy, because one of its docs' Reference leads to
Screen is the type of what's visible before the ellipsis. So the attribute's full path is:
X depends on the screen's subdivision, and
Y is 0 if the 3D View is visible in that area. You can find that out from Console:
It's easier to read 3D View space's settings through
bpy.context.space_data, if the 3D View area is active (i.e. accessed through an operator executed from the 3D View itself).
bpy.context.area.spaces, if accessed through a Console whose display type is directly switched from a 3D View.
bpy.context.screen.areas[X].spaces if accessed through a Console in another area, index
X must be searched beforehand.
show_grease_pencil attribute is accessible through these different paths.