Add button to TOPBAR_MT_render
Append or Prepend a draw method to menu class. 

Very closely related How to add a checkbox to a pie menu?



import bpy

def draw(self, context):
    layout = self.layout
    scene = context.scene
    render = scene.render

    layout.prop(render, "use_lock_interface")

def register():
    bpy.types.TOPBAR_MT_render.append(draw)

# make your unregister and remove draw
if __name__ == "__main__":
    register()


TIP Turn on developer extras in user preferences and can right click to  view source (Edit Source, as it opens in text editor.) of most UI elements.

Add toggle hotkey to custom checkbox