Extend obj->iternext to handle not just __next__(), but also send() method
For generators (generalization of iterators), .__next__() method is defined as .send(None). It's only natural to extend C-level ->iternext() method to accept send argument, to allow implementation of C-level generators optimally. Caveat: so far, none of such exist. But work on optimizing uasyncio may lead to need for such. Or maybe not, maybe "virtual" awaitable methods will be used instead: https://github.com/micropython/micropython/issues/2622 .
This ticket is created to be referenced by in-code TODO comments (yes, I think we reached that code complexity that need to reference tickets straight from code).
Need mp_const_stop_iteration variant which can hold an argument value
StopIteration(val) has important meaning for generators. To optimize exception handling (not allocate big exception objects and nlr_buf_t stack frames), we need special sentinel value like mp_const_stop_iteration, but which can hold an mp_obj_t (arg of StopIteration). The idea is to convert exception as generated by bytecode to a sentinel value which can be just returned instead of being thrown. Of course, such value will need to be dynamically allocated, but again, we'll save a lot of stack on nlr_push'ed to catch StopIteration's after they are thrown.