Typescript Reduce Sum Python Function Overloading