Set 'Drop' control to any function key (F1-f12)
Open anvil interface
Place any item in either slot, attempt to rename item
Put mouse over new item shown
Press drop key
The result item will be dropped and no EXP will be deducted. Even works if you have zero EXP or to combine enchants instead of just renameing.
I've observed this in a Bukkit server (spigot), and vanilla minecraft single player. Have not tested other versions.
Environment
OS X 10.8.2, Java 1.6.0_43 and 1.7
Marked as duplicate of MC-11229.