Dropping z dimension programmatically
For future reference - QGIS 3 includes a drop z value processing algorithm
Specifically, the QGIS 3 tool is called Drop m/z values
. It's in the Processing Toolbox, under Vector Geometry. The documentation is here:
https://docs.qgis.org/testing/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#qgisdropmzvalues