This would allow wallet operations like funding transactions with smart contract-based inputs such as LN, or any input the Core wallet doesn't know how to sign for.

https://github.com/bitcoin/bitcoin/pull/17211#issuecomment-933674310
{
    m_spk_man = p->GetScriptPubKeyMan(type, internal);
    if (!m_spk_man) {
        error = strprintf(_("Error: No %s addresses available."), FormatOutputType(type));
        return false;
    }
    if (nIndex == -1)
    {
        m_spk_man->TopUp();
        CKeyPool keypool;
        if (!m_spk_man->GetReservedDestination(type, internal, address, nIndex, keypool, error)) {
            return false;
        }
        fInternal = keypool.fInternal;
    }
    dest = address;
    return true;
}
void ReserveDestination::KeepDestination()
{
    if (nIndex != -1) {
        m_spk_man->KeepDestination(nIndex, type);
    }
    nIndex = -1;
    address = CNoDestination();
}
void ReserveDestination::ReturnDestination()