While this didn't cause any problems, it was incorrect.
bpy.data.orphans_purge()
Quaternion.to_euler()