The only possible difference (from the resulting binary POV) I can think of is "static const" variables might be allocated in a read-only executable section?
Crashing is exactly what happens, thankfully
extern void mutate(int *p);
int func() {
const int foo = 7777;
mutate(&foo);
return foo;
}The compiler can indeed put const objects in the executable's .rodata section, which means trying to modify it at runtime will probably cause a segfault (but it's all Undefined Behavior so who knows).
const int a = 1;
If you try to const_cast away the const of x to change its value, you have undefined behaviour. As for pointers, if you make a const pointer to a non-const object then all it means is that you cannot modify the object via that pointer, not that the object will never be modified.
int a = 1; int b = &a; const int c = &a;
a = 2;
Both b and c are now 2 and this is absolutely fine, and the compiler won't try to optimise out any reads of *c and assume its value is still 1 as const/non-const pointer aliasing is allowed (C has the restrict keyword, it's not in C++).