Export volume (or segment?) to stl file with python

This post ended up providing enough of a solution framework for me to figure it out.