How do i display the Collapse Menus checkbox in a Python menu?
Not sure how to expose the property that indicates whether the header region menu is collapsed or not. You can however add the bpy.ops.screen.header_toolbox() operator to the view menu.  This is the header menu that pops up when right clicking in Header.

Notice I've appended / prepended to the view menu class, rather than, (.. the slippery  slope of), editing the UI py.

import bpy


def header_toolbox(self, context):
    layout = self.layout
    #layout.operator("screen.header_flip")
    layout.operator("screen.header_toolbox")

# prepend to 3d view view menu
bpy.types.VIEW3D_MT_view.prepend(header_toolbox)
# append text editor view menu
bpy.types.TEXT_MT_view.append(header_toolbox)