Python Threading Return Value Optimization