Some comments from @sipa in #12702.

___

Yes, I think `importmulti` is superior in every way, except:
* Slightly less convenient to use (it requires redundant information, as you have to explicitly state what you want to import, and then give the keys/... to enable that).
* ~Doesn't support P2SH-P2WPKH yet~. Added in #14454

The latter can be fixed by just adding support for that case. The former can be improved by adding 'default' cases (e.g. if you prove a WIF private key, it can permit omitting the address, ...).

CScript script = CScript(vData.begin(), vData.end());
               CScriptID id(script);
               if (pwallet->HaveCScript(id)) {
                   pwallet->WalletLogPrintf("Skipping import of %s (script already present)\n", vstr[0]);
                   continue;
               }
               if(!pwallet->AddCScript(script)) {
                   pwallet->WalletLogPrintf("Error importing script %s\n", vstr[0]);
                   fGood = false;
                   continue;
               }
               int64_t birth_time = DecodeDumpTime(vstr[1]);
               if (birth_time > 0) {
                   pwallet->m_script_metadata[id].nCreateTime = birth_time;
                   nTimeBegin = std::min(nTimeBegin, birth_time);
               }
            }
        }
        file.close();
        uiInterface.ShowProgress("", 100, false); 
        pwallet->UpdateTimeFirstKey(nTimeBegin);
    }
    uiInterface.ShowProgress("", 100, false); 
    RescanWallet(*pwallet, reserver, nTimeBegin, false );
    pwallet->MarkDirty();
    if (!fGood)
        throw JSONRPCError(RPC_WALLET_ERROR, "Error adding some keys/scripts to wallet");
    return NullUniValue;
}
UniValue dumpprivkey(const JSONRPCRequest& request)