A quick valgrind run for
from sage.all import sqrt
T2 = sqrt(2)
for b in range(num := 100_000):
C = sqrt(T2)
confirms that it is in pynac:
==3947957== 799,912 bytes in 99,989 blocks are definitely lost in loss record 1,299 of 1,300
==3947957== at 0x484182F: malloc (vg_replace_malloc.c:431)
==3947957== by 0x1A6D3B07: sig_malloc (memory.c:1898)
==3947957== by 0x1A6D3B07: __pyx_f_4sage_3ext_6memory_sage_sig_malloc (memory.c:1517)
==3947957== by 0x13D0EC2B: ???
==3947957== by 0x13D0FEFD: ???
==3947957== by 0x1FBA2393: GiNaC::numeric::integer_rational_power(GiNaC::numeric&, GiNaC::numeric const&, GiNaC::numeric const&) (numeric.cpp:1621)
==3947957== by 0x1FBA266D: GiNaC::numeric::integer_rational_power(GiNaC::numeric&, GiNaC::numeric const&, GiNaC::numeric const&) (numeric.cpp:1614)
==3947957== by 0x1FBA94DC: GiNaC::rational_power_parts(GiNaC::numeric const&, GiNaC::numeric const&, GiNaC::numeric&, GiNaC::numeric&, bool&) (numeric.cpp:1692)
==3947957== by 0x1FBAA2AF: GiNaC::numeric::power(GiNaC::numeric const&) const (numeric.cpp:1916)
==3947957== by 0x1FBBA918: GiNaC::power::eval(int) const (power.cpp:536)
==3947957== by 0x1FB09107: GiNaC::ex::construct_from_basic(GiNaC::basic const&) (ex.cpp:923)
==3947957== by 0x1FBB9D89: ex (ex.h:314)
==3947957== by 0x1FBB9D89: GiNaC::power::eval(int) const (power.cpp:507)
==3947957== by 0x1FB09107: GiNaC::ex::construct_from_basic(GiNaC::basic const&) (ex.cpp:923)
==3947957==