What if I decide to accept losing a bit of time importing IFC to Blender (even with the UI), what is the appropriate python code to use this operator : BlenderBim->Quantity Take Off-> Calculate All Quantities ?
So, in order to know the exact command to execute, it's sufficient to right click on the operator button (in blender ui) and put the mouse over the "edit source" with the option "python tooltips" activated in blender preferences (submenù interface). In this way you know the command for every operator.
In this case the command is _bpy.ops.bim.calculate_allquantities()
Looking at the qto_calculator functions, basically, in order to calculate the quantities (volume, length, height, etc...) qto_calculator uses blender functions or bmesh or shapely, etc.. but it's always needed the blender object to perform the calculations.
But i think that what you are attempting to do is doable.
For example, the trick i've done to calculate the gross volume was to recreate another blender object from ifc entity without openings and, in order to do that, i used the ifcopenshell geom functions. Look at this and also the documentation of course.
Keep going btw, i'm also interested in what you are doing because this could be the beginning of a "native ifc" quantity takeoff method :-)