First I used a method of extracting square root which I was taught in my childhood. The problem was solved, but it was very tedious.
I therefore solved it by arbitrary-precision arithmetic.
For example, in the case of
>>> sum(map(int, list(str(math.isqrt(10**198 * 2)))))
475