addmultisigaddress creates an address respecting the setting, being unable to generate a specific type of address without also adding it to the wallet seems wrong.

I suppose in the future `addresstype` may be refactored to be wallet-specific, which would leave this non-wallet rpc call without an argument. Perhaps there should just be an optional parameter to set it.
{
    std::map<CTxDestination, CAmount> balances;
    {
        LOCK(cs_wallet);
        for (const auto& walletEntry : mapWallet)
        {
            const CWalletTx *pcoin = &walletEntry.second;
            if (!pcoin->IsTrusted())
                continue;
            if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
                continue;
            int nDepth = pcoin->GetDepthInMainChain();
            if (nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? 0 : 1))
                continue;
            for (unsigned int i = 0; i < pcoin->tx->vout.size(); i++)
            {
                CTxDestination addr;
                if (!IsMine(pcoin->tx->vout[i]))
                    continue;
                if(!ExtractDestination(pcoin->tx->vout[i].scriptPubKey, addr))
                    continue;
                CAmount n = IsSpent(walletEntry.first, i) ? 0 : pcoin->tx->vout[i].nValue;
                if (!balances.count(addr))
                    balances[addr] = 0;