yes, you can cast away const, and also private.
in both cases it can be (always is for private) 'undefined behavior' that may or may not work, and if it does work, a recompile in the future may or may not work then. Its a terrible thing to do (looking at point 3 below scenarios here). Its just pointer magic -- the compiler watches variables, but not memory locations, so if you can get a non const pointer to a const memory location you can mess with it; except that when optimizing the compiler MAY put the constant value you typed in the code into the machine language, so there IS NO real address to modify, so your changes could {work, not work, mix of the two} in various places in the code. For this to work, the constant must have a memory location to begin with, which some do not. Turning off optimize may do the trick, but who would ever do that; its like 2-3 times slower on average.
https://www.geeksforgeeks.org/const_cast-in-c-type-casting-operators/
read this and pay attention to point # 3.
or to confusingly TLDR / executive summary:
const cast removes const from things that were NOT constant at declare but became constant at a later time, restoring their original mutability. Things that were constant at declare can only be changed with unsafe hackery.
I don't think I have ever needed const cast, but I am not sure that where I worked we followed strict const correctness concepts either. If you do that religiously, you will need const cast now and then to bypass an unnecessary/excessive const somewhere in your code.