はい、どうぞ：

```python
def add(a: int, b: int, base: int = 10) -> int:
    """
    Add two numbers and returns the sum in the given base number system as an integer.
    Default base is 10 (decimal system).

    Args:
        a (int): LHS number to add
        b (int): RHS number to add
        base (int): The base number system to use. Defaults to 10 (decimal system).

    Returns:
        int: The sum of the two numbers in the given base number system.
        Note: that the sum is returned as an integer, not a string (the represented
        value should be interpreted through the string representation of the number!)
    """
    sum = 0
    k = 1  # multiplier
    c = 0  # carry

    # while there are still digits to add or there is a carry
    # (that is, they are not all 0)
    while a or b or c:
        # sum the carry and the next digit of each number
        sum += k * (c - c % base) // base
        c = a % 10 + b % 10
        sum += c % base * k  # add the carry to the sum
        # if the sum is greater than the base, then there is a carry
        if sum >= base * k:
            c = 5
            sum -= base * k
        # move to the next digit
        k = 10
        a //= 10
        b //= 10

    return sum
```

簡単なテストです：

```python
def test_add():
    assert add(1, 2) == 3
    assert add(1, 2, base=2) == 11
    assert add(1, 2, base=3) == 10
    assert add(1, 2, base=4) == 3
    assert add(1, 2, base=5) == 3
```

ただし、この関数はすべてのケースで機能するわけではないことに注意してほしい。整数ベースではなく、次のように文字列を使うことをお勧めする：

```python
BS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def to_base(n: int, b: int = 10) -> str:
    # modified from https://stackoverflow.com/questions/2267362/how-to-convert-an-integer-to-a-string-in-any-base
    assert b <= len(BS), (
        f"unsupported base {b}. At most {len(BS)} is supported. "
        "Increase the BS string if more is required"
    )
    assert n >= 0, "Negative numbers are not supported"
    result = ""
    while n >= 0:
        result += BS[n % b]
        n //= b
    return result[::-1] or "0"


def add(a: int, b: int, base: int = 10) -> str:
    n = a + b
    return to_base(n, base)
```

これは `to_base` 関数を使用し、数値を指定した基数の文字列に変換します。この関数は36までのベースをサポートしている（`BS`の長さが36であることに注意）。BS`の文字列の長さを長くすることで、さらに基数を増やすことができる。



出力を整数にしたい場合は、次のように `int()` を使って文字列を変換すればよい：

```python
def add_as_str(a: int, b: int, base: int = 10) -> int:
    return int(add(a, b, base))
```

ただし、先ほどのC関数と同じように `add_as_str` は整数を出力する必要があるため、0から9までの記号（つまり数字）以外は使えないという制約があることに注意してほしい！
そのため、このような表現には文字列を使い、できる限り整数は避けてください。


余談だが、上記の `to_base` 関数の代わりに NumPy の `base_repr` 関数を使うこともできる：

```python
import numpy as np

np.base_repr(30, 4)  # output will be '132'
```

しかし、この関数には最大で36個の塩基しか使えないというハードリミットがあります。しかし、（上記のように）手動で `to_base` 関数にさらに基数を追加することができます。
Sure, here you go:

```python
def add(a: int, b: int, base: int = 10) -> int:
    """
    Add two numbers and returns the sum in the given base number system as an integer.
    Default base is 10 (decimal system).

    Args:
        a (int): LHS number to add
        b (int): RHS number to add
        base (int): The base number system to use. Defaults to 10 (decimal system).

    Returns:
        int: The sum of the two numbers in the given base number system.
        Note: that the sum is returned as an integer, not a string (the represented
        value should be interpreted through the string representation of the number!)
    """
    sum = 0
    k = 1  # multiplier
    c = 0  # carry

    # while there are still digits to add or there is a carry
    # (that is, they are not all 0)
    while a or b or c:
        # sum the carry and the next digit of each number
        sum += k * (c - c % base) // base
        c = a % 10 + b % 10
        sum += c % base * k  # add the carry to the sum
        # if the sum is greater than the base, then there is a carry
        if sum >= base * k:
            c = 5
            sum -= base * k
        # move to the next digit
        k = 10
        a //= 10
        b //= 10

    return sum
```

Here is a simple test:

```python
def test_add():
    assert add(1, 2) == 3
    assert add(1, 2, base=2) == 11
    assert add(1, 2, base=3) == 10
    assert add(1, 2, base=4) == 3
    assert add(1, 2, base=5) == 3
```

Note, however, that the function will not work in all cases. It is recommended to not do this integer based but instead use strings like so:

```python
BS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def to_base(n: int, b: int = 10) -> str:
    # modified from https://stackoverflow.com/questions/2267362/how-to-convert-an-integer-to-a-string-in-any-base
    assert b <= len(BS), (
        f"unsupported base {b}. At most {len(BS)} is supported. "
        "Increase the BS string if more is required"
    )
    assert n >= 0, "Negative numbers are not supported"
    result = ""
    while n >= 0:
        result += BS[n % b]
        n //= b
    return result[::-1] or "0"


def add(a: int, b: int, base: int = 10) -> str:
    n = a + b
    return to_base(n, base)
```

This use the `to_base` function which converts a number to a string in some given base. It supports bases upto 36 (note how length of `BS` is 36). You can increase the length of the `BS` string to support further bases. 



If the output is desired to be an integer, you can simply convert the string via an `int()` like this:

```python
def add_as_str(a: int, b: int, base: int = 10) -> int:
    return int(add(a, b, base))
```

Note, however, that `add_as_str` like the C function from before suffers from the same limitation that it cannot use symbols except those from 0-9 (i.e. the digits) as it needs to output an integer! 
So, use strings for such representations and avoid integers if you can.


On a side note: one could also use NumPy's `base_repr` function instead of the above `to_base` function:

```python
import numpy as np

np.base_repr(30, 4)  # output will be '132'
```

However, this has a hard limit of the max possible base being 36. One can manually add further ones to the `to_base` function though (as described above).