Python Threading Return Value Optimization In C