Why is mesh.from_pydata resulting in segmentation faults?
The method from_pydata appears to be surprisingly brittle for something in Python. Something as simple as using a vertex index number that is out of bounds (number higher or equal to the number of vertices) will result in odd results followed by a segfault shortly after (for example by going from object mode to vertex mode).
Calling validate should at least prevent a segfault from happening. You'll have to look for what is exactly invalid with your parameters when calling from_pydata):
my_mesh.validate()

Edit: I spent a bit of time chasing segfaults with from_pydata myself until I eventually found reports such as the ones below. I don't imagine the use of it without validate since segfaults taking the whole process down are quite annoying.

https://developer.blender.org/T32773
https://developer.blender.org/T50199