Description
Adapt #2003 and the last commit of #2005 (inplace optimization on untraced_sit_sot) to python/cython scan which don't currently exploit it.
Note we don't do the automatic conversion to sit_sot to untraced_sit_sot in those backends because scan always gives it at least 2 entries in the circular buffer (as it tries to pass the next entry for the inner function to write directly to).
Description
Adapt #2003 and the last commit of #2005 (inplace optimization on untraced_sit_sot) to python/cython scan which don't currently exploit it.
Note we don't do the automatic conversion to sit_sot to untraced_sit_sot in those backends because scan always gives it at least 2 entries in the circular buffer (as it tries to pass the next entry for the inner function to write directly to).