Your issue is independent of the method having a bang. If you want to replace the receiver string, use the method String#replace
.
class String
def foo
replace(whatever_string_you_want_to_replace_the_receiver_with)
end
end
You can perhaps put mb_chars.upcase
as the argument to replace
.