Wrote get-best-common-ancestor-for-merge which solves my test case without caching subrepo-push commands! It does this by searching for when the last subrepo push was made, then using that as the common-ancestor so that the merge on a subrepo-pull will work. Importantly my technique doesn't use the I/O expensive git-filter-branch in its search.
Moved old logic I had added into separate functions to clean up the pull and push commands.