Rebmu: 9 (w/penalty) or 13 (without)
The boring Rebmu solution is 9 and bears the palindromic penalty. I'll show it anyway "just because":
rnRVaVRnr
Using the unmushing trick of noticing capital runs of letters are separate words, and the lack of a leading capital run means we're not making a set-word, we produce five ordinary words:
rn rv a vr nr
Which is a shorthand for the equivalent code (also legal Rebmu):
return reverse a vr nr
The fact that vr and nr are meaningless doesn't matter, because despite not being assigned to anything they are valid words. So the evaluator only runs the return reverse a
...it works both ways. But this is analogous in a sense to the boring cheat: the code isn't commented out, but it's dead and not executed on one path.
For something more exciting that doesn't incur the penalty, how about this 13 character solution:
a VR :rv AvrA
Let's look at how this is processed on its forward and reverse paths, when expanded. Forward:
a ; evaluate a, as it is a string it has no side effects
vr: :reverse ; "set" vr to mean what a "get" of reverse means now
a: vr a ; assign a to calling "vr" on a, effectively reversing
; ^-- result of assign is last expression, the answer!
Backwards as ArvA vr: RV a
:
a: reverse a ; assign A to its reversal
vr: rv: a ; make the abbreviation vr equal to assignment of a to rv
; ^-- result of assign is last expression, the answer!
On the downside, the backwards variant is overwriting the abbreviation for reverse. But hey, it's not a palindrome, and it's a mere 13 characters. :-)
(Note: This assumes you're running Rebmu in the /args mode, where a is the default argument to the program passed to the interpreter on the command line and you accept the result. If reading from standard input is actually a requirement, things grow e.g. from 9 to 11 characters for the simple solution: rnRVrArVRnr
. And if you have to print to standard output from within the program instead of accepting the expression output of the interpreter that would add a couple characters too.)
-1%#%1-/1
or-1%#%(0
? \$\endgroup\$