The physics
Put a mass m at a distance r from a planet's centre. Its potential energy U is negative. It rises to zero far away.
U = −G M m / r G M = g R²
A launched probe trades K for U as it climbs. Its total E = K + U stays the same. If E is below zero, it stops and falls back. If E is zero or more, it never comes back.
vₑ = √(2GM / R) = √(2gR) about 11.2 km/s for the Earth
The escape speed goes as √(M/R). Since M = ρ(4/3)πR³, it also goes as R√ρ.
A satellite on a circle already moves at √(GM/r). The escape speed from there is √2 times that.
vorbit = √(GM / r) vescape = √(2GM / r)
Inside a uniform planet, the potential keeps falling to the centre. There it is 1.5 times its value at the surface.
With several bodies, add the potential energies. Then find the speed once, from the total.