julia> const x=2
2
julia> x=3
WARNING: redefinition of constant x. This may fail, cause incorrect answers, or produce other errors.
3
julia> @quiet x=1
1
julia>
I wrote this macro a few days ago, and registered it in my startup.jl, for another usage: sometimes I run a gaming program, highly recursive, and I wish interrupting it (CTRL/C) without displaying a long stacktrace of recursive calls.
Perhaps you should explain why do you want to redefine constants, particularly since you seem to want to be doing that many times, as you are worried about speed. (probably it is not a good idea and there are better solutions to what you want to do).
Recently there was a lengthy discussion about if redefining constants is undefined behavior or not, and the takeaway is that, at least for now, the Julia devs consider it to be undefined behavior. I do not really understand why are you worried about suppressing this message if your program has absolutely no guarantees of working as intended after this happens.
You should never be redefining constants in a final working program. If you do, all bets are off and your program might do arbitrarily badly behaved things. It probably won’t, but it might.