Multiple function calls in loops, etc.
While there may have been a query plan issue at some point with packages, I doubt that's the case any longer. Everyone, but everyone, says to put your DML in a function.
BTW, did you mean the Oracle optimizer...? ;-)