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, ...).

throw JSONRPCError(RPC_WALLET_ERROR, "Wallet " + wallet_name + " already exists.");
    }
    
    if (!CWallet::Verify(wallet_name, false, error, warning)) {
        throw JSONRPCError(RPC_WALLET_ERROR, "Wallet file verification failed: " + error);
    }
    std::shared_ptr<CWallet> const wallet = CWallet::CreateWalletFromFile(wallet_name, fs::absolute(wallet_name, GetWalletDir()), (disable_privatekeys ? (uint64_t)WALLET_FLAG_DISABLE_PRIVATE_KEYS : 0));
    if (!wallet) {
        throw JSONRPCError(RPC_WALLET_ERROR, "Wallet creation failed.");
    }
    AddWallet(wallet);
    wallet->postInitProcess();
    UniValue obj(UniValue::VOBJ);
    obj.pushKV("name", wallet->GetName());
    obj.pushKV("warning", warning);
    return obj;
}
static UniValue unloadwallet(const JSONRPCRequest& request)
{
    if (request.fHelp || request.params.size() > 1) {
        throw std::runtime_error(
            "unloadwallet ( \"wallet_name\" )\n"
            "Unloads the wallet referenced by the request endpoint otherwise unloads the wallet specified in the argument.\n"
            "Specifying the wallet name on a wallet endpoint is invalid."
            "\nArguments:\n"
            "1. \"wallet_name\"    (string, optional) The name of the wallet to unload.\n"
            "\nExamples:\n"
            + HelpExampleCli("unloadwallet", "wallet_name")
            + HelpExampleRpc("unloadwallet", "wallet_name")
        );