Background
When generating temporary user names, the $wgAutoCreateTempUser['serialMapping']['type'] config determines how the unique, numerical part of the name is generated.
The simplest of these is plain-numeric, handled by the PlainNumericSerialMapping class, which returns an index stored in the database.
Problem
When changing modes, as required in the parent task, this can cause naming conflicts.
Solution
We can avoid this by defining a $wgAutoCreateTempUser['serialMapping']['offset'] config, which defines an integer added to the stored index by PlainNumericSerialMapping, and setting it to something above the maximum generated number for an existing temporary user name.