fn extract_traceback(py: Python<'_>, error: PyErr) -> String
Flattens a chain of errors into a single string.