surface area of a mesh using Python code in Blender
One way is to sum bmesh face.calc_area() for all faces.

import bpy
import bmesh

obj = bpy.context.active_object

bm = bmesh.new()
bm.from_mesh(obj.data)

area = sum(f.calc_area() for f in bm.faces)
print(area)

bm.free()


Will give result in objects local space would need to allow for scale.  eg if the object is scaled by (2, 2, 2) would need to multiple result by 2 x 2.  Or apply scale before calculation.