How does Blender implement flat shading non-planar polygons?
Blender's face normals are calculated as follows:


For quads, we use the cross product of 2 edge vectors which don't share a vertex.
For polygons, we use Newell's Method.


To draw with these normals, we store the tessellated triangles and simply copy the normals calculated from the original faces, into each of the tessellation triangles normals (which is sent as a buffer to the GPU).

See: gpu_buffers.c for details (though you will probably want to see how this API is used by other files to see how it works).