Not sure this is the best way to do it but an alternative is using bpy.ops.object.convert(). You might want to make sure the context is correct and that only the relevant object is selected before executing the operator.
Interesting–that method would be much more straightforward, but I avoid it because I get context errors whenever I try it, whether in 2.7 or 2.8. Have you got an example of how to use it correctly in 2.8?