Sorting Collections Alphabetically in the Outliner
Fully recursive and optionally case-sensitive:

import bpy

def sort_collection(collection, case = False):

  if collection.children is None: return

  children = sorted (
    collection.children, 
    key = lambda c: c.name if case else c.name.lower()
  )

  for child in children:  
    collection.children.unlink(child)
    collection.children.link(child)
    sort_collection(child)

# case_sensitive sort, (default is False)
case_sensitive = True

for scene in bpy.data.scenes:
    sort_collection(scene.collection, case_sensitive)