Merge "Reduce unnecessary overhead of for-each input flags" into main