Say I define a list object and only want it to be read-only in a function I define. In C++, you'd do this with a const reference. Is there any way to do this with a python function? Does this make sense with respect to writing "pythonic" code or am I just trying to apply a C++ paradigm incorrectly?
In Python, all variables are references, so having an equivalent of C's const wouldn't really do anything. If the pointed-to object is mutable, you can mutate it; if it's immutable, you can't.
However, there are some types that are mutable, and some that aren't. Lists are mutable, but tuples are not. So if you pass your data as a tuple, you're guaranteed the function can't do anything to it.
To use a C metaphor, a list of integers is somewhat like an int[], and a tuple of integers is a const int[]. When you pass them to a function, it doesn't matter if you're passing a const reference or a non-const reference; what matters is whether the thing it references is const or not.
Is it possible to force data immutability in a python function?