Is it possible to change the active bl_category with python?
Search registered classes.

To get all the classes in bpy.types that are a subclass of bpy.types.Panel and bl_space_type == 'VIEW_3D'

&gt;&gt;&gt; for p in dir(bpy.types):
...     cls = getattr(bpy.types, p)
...     if (issubclass(cls, bpy.types.Panel)
...         and getattr(cls, "bl_space_type", "") == 'VIEW_3D'):
...             p, getattr(cls, "bl_category", "No Category")
...             
('CYCLES_VIEW3D_PT_shading_lighting', 'No Category')
('CYCLES_VIEW3D_PT_shading_render_pass', 'No Category')
('TOPBAR_PT_annotation_layers', 'No Category')
('TOPBAR_PT_gpencil_layers', 'No Category')
('TOPBAR_PT_gpencil_materials', 'No Category')
('TOPBAR_PT_gpencil_primitive', 'No Category')
('TOPBAR_PT_tool_fallback', 'No Category')
('VIEW3D_PT_active_tool', 'Tool')
('VIEW3D_PT_active_tool_duplicate', 'Tool')
('VIEW3D_PT_annotation_onion', 'View')
('VIEW3D_PT_collections', 'View')
('VIEW3D_PT_context_properties', 'Item')
('VIEW3D_PT_gizmo_display', 'No Category')
('VIEW3D_PT_gpencil_draw_context_menu', 'No Category')

... and lots more


Ok, lets recategorize  bpy.types.VIEW3D_PT_grease_pencil   from "View" to "Foo"

Check if it's registered (should be since it is in bpy.types, unregister it, change the category, re-register.

&gt;&gt;&gt; cls = getattr(bpy.types, "VIEW3D_PT_grease_pencil")
&gt;&gt;&gt; if cls.is_registered:
...     cls.bl_category
...     bpy.utils.unregister_class(cls)
...     cls.bl_category = "Foo"
...     bpy.utils.register_class(cls)
...     
'View'




Note this "trick" is used in some addons as an update on an addon preferences string property to recategorize panels

Inspect the module.

Similarly, since a lot of these are from bl_ui.space_view3d can inspect the module

&gt;&gt;&gt; import importlib, inspect

&gt;&gt;&gt; for name, cls in inspect.getmembers(importlib.import_module("bl_ui.space_view3d"), inspect.isclass):
...     if name.startswith('VIEW3D_PT'):
...         name, getattr(cls, "bl_category", "No Category")
...         
('VIEW3D_PT_active_tool', 'Tool')
('VIEW3D_PT_active_tool_duplicate', 'Tool')
('VIEW3D_PT_annotation_onion', 'View')
('VIEW3D_PT_collections', 'View')
('VIEW3D_PT_context_properties', 'Item')
('VIEW3D_PT_gizmo_display', 'No Category')
('VIEW3D_PT_gpencil_draw_context_menu', 'No Category')
... and many more


be remiss not to mention, most blender modules that register classes, have a classes list or tuple

from bl_ui.space_view3d import classes

for cls in classes:
     ... as above


or for every addon ... addon_utils.modules() provides a list of addon modules, that can be inspected as above to look for more, that may not even be enabled / registered.

AFAIK it's not possible to set the active panel / category (tab)