Access Viewport Overlay options using Python API
The overlay attribute is part of the bpy.types.SpaceView3D. Therefore you first need to iterate over the areas of the current screen and find the 3D View. Then you can search for the space in the area that has the type attribute set to 'VIEW_3D' and is therefore of type bpy.types.SpaceView3D. If such a space exists you can access the overlay and through it show_face_orientation.

import bpy


for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        for space in area.spaces:
            if space.type == 'VIEW_3D':
                space.overlay.show_face_orientation = not space.overlay.show_face_orientation
                break


Note that you cannot set the overlay option  using the code above if you don't have an area with the 3D View open in the current screen.