It is not a federal crime to write on bills. It is only a crime to deface bills to the point that they become unusable:
moneyfactory . gov / historicallegislation.html
(emphasis mine)
"Defacement of currency is a violation of Title 18, Section 333 of the United States Code. Under this...