Yeah, the first method crossed my mind. Could you also do something like this? Ie lazily getting the index of each tab that was just moved over.

ALT Code screenshot:
function moveTabs({ tabIds, toTabIndex, toWindowIndex }) {
let tabToMoveAfter = getTabId(toWindowIndex, toTabIndex)
for (let tabId of tabIds) {
let tabIndex = getTabIndex(tabToMoveAfter)
moveTab(tabIndex + 1, toWindowIndex)
tabToMoveAfter = tabId
}
}
// I think getTabId, getTabIndex and moveTab are all efficient
// operations available by using/combining various web extension
// tab/window APIs?