Is there a nice way in Stata to develop a group mean of a variable and keep the original name? (The original variable is already a cluster-level variable and should preferably retain its name; the idea is to let all individuals in a group get a value on the group variable after appending data.)

I end up with something like...

Code:
rename my_variable my_variable_x
egen   my_variable = mean(my_variable_x), by(group)
drop   my_variable_x
... which is okay with one or two variables, but once you do this for 10 variables or so, this is really ugly code and probably also dysfunctional code.

I'm looking for single-line code. This should be doable with Stata's concept of local macros, I guess?