It’s not as simple as generally moving positional arguments to keyword arguments, though. A dozen non-optional keyword arguments is just as unwieldy, and the ability to write them in an arbitrary order doesn’t make up for the extra writing of keywords or sacrificing method dispatch. Keywords are much more useful for optional arguments with default values, which tend to lean towards “how” (options) instead of “what” (data).
Grouping arguments into a composite type also has to be done on a case by case basis. If those arguments don’t form a cohesive group across various function calls, even roughly, then throwing them into a composite type right before function calls and needing to disassemble it right after has little benefit. A complete lack of cohesion across so many arguments is just rare enough that one should first suspect otherwise. It’s hard to tell because it’s not a MWE, but it does appear that many unchanged arguments are passed to callees and could be grouped together.
The inner _evaluate
call appears to take arguments in a different order, implying there’s another method. If that’s not supposed to be a recursive method, it shouldn’t be the same function so there’s no risk of edits accidentally causing recursion.