How to ensure all headers are at the top of the editors every time
Script using bpy.ops.screen.region_flip

The following script flips all area headers in all screens in window to top.  To flip to bottom instead change if region.type == 'HEADER' and  not (region.y - area.y): to if region.type == 'HEADER' and (region.y - area.y): ie remove the not.

import bpy


context = bpy.context
c = {}  # override dictionary
window = context.window
c["window"] = window
for screen in bpy.data.screens:
    #window.screen = screen
    c["screen"] = screen
    for area in screen.areas:
        c["area"] = area
        for region in area.regions:
            if region.type == 'HEADER' and  not (region.y - area.y):
                c["region"] = region
                bpy.ops.screen.region_flip(c)


EDIT: note some, and in particular 3D areas, don't flip correctly and stay on bottom, but pro-port to be on top by the "flip to bottom" tooltip in UI. (only the tooltip toggles, not the header)