Who can solve this?

I don't think you're understanding the problem.
Just to clarify, here's a random example where it took 6 steps to leave the circle.

(The line segments are supposed to be the same size as the circle's radius, but I didn't really measure them.)

And here's a random example of where it took just 1 step to leave the circle.

Trying to solv this mess, but I'm having difficulty considering the probability of staying in the circle when a point is inside the circle. I'm sure it must depend solely on it norm, but I'm not sure, for a point outaide the circle I used the tangents, but here i don't know.

>random direction

Meaning everything to the right of this red line is also a likely direction, all of which still take 1 full distance/step, if the starting point is the edge where the arrow is..

yes, correct

So I'm guessing first find the distribution function in terms of distance r from the center of the circle. Then use that to find the probability of remaining in the circle given that you currently are some point within the circle. After that solve for the expected value by Negative Binomial Distribution. The distribution even fits the plotted graph.

idk sounds good

I would think that the chance of the second step staying inside the circle is the average of 1/3 and 1/2. But the simulation seems to say not. It seems to say this chance is 2/5 instead of 5/12. So Either my analysis is wrong or the simulation is wrong.

Ah OK, I think I have it. The chance of the nth step staying inside the circle is the average of the (n-1)th and (n-2)th steps.

2/3+2(1/3)(1-(1/3+1/2)/2)+3(1/3)(5/12)(1-(5/12+1/3)/2)+4(1/3)(5/12)(15/24)(1-(15/24+5/12)/2)...

Does anyone know any methods to solve for g(x)?

I get ~1.56 with simulations too