Mimicking pass by value and pass by reference simentenoulsy in python?

(Context)
Consider C++ where we have concepts of pointers.
If we have a variable x, and functions f(x) we can pass x by value or reference depending on if we use pointers or not.

I can mimic the same behavior in python by choosing x to be a mutable (resp. immutable) if I want to pass x by reference (resp. value). So far so good.

Now again consider C++ where we have a variable x and two functions f(x) and g(x) such that f(x) takes by value and g(x) takes by reference. Just like mentioned above, we use pointer in g(x) to get the desired behavior.

(Actual Problem)

The problem comes when I try to immitate the previous behavious in python .i.e. have a variable x and two function f(x) and g(x) where f(x) doesn’t change the value of x and g(x) change the value of x. Since my variable can’t be simentenoulsy be a mutable and immutable, it seems to me that I can’t immitate this behavior in a reasonable way.

This just is not how Python is designed. The issue is similar to the discussion going on in here.

Python passes by value, but sometimes that value is a pointer to a data structure.