Interesting. C++ sort of has parts of this concept with const and std::move operators.
From your code example, I feel like one problem is that arguments are passed the same way wether it's r, w, or o. Meaning that if e.g. the foo(x: r i32) API changes to foo(x: o i32), your code that was previously modifying x afterwards would now break.