Never compromise the quality of your code.
Writing junk code is a false economy.
As other posters have suggested you can achieve this by using specific tools for mock ups.
However, there are different reasons to building prototypes. Sometimes you can show what you need to without writing code, but often this is not the case. A stakeholder might want you to demonstrate the technical feasibility of a feature.
Build the absolute leanest thing you can to demonstrate the feature/prove the concept. Leave out anything else.
For a UI feature, make sure you don't develop anything on the server - dont touch it at all. Develop again mocks/fakes built in.
If you need to put effort into making the UI conform to the style of the rest of the application dont bother. If it looks good enough without any effort then change the colours to make it stand out, or maybe even a watermark to show that it is a prototype.
I've found the most likely offenders of causing prototypes to turn into production code are sales people. They will sell your product to new customer - without this new feature, the client would not have signed. You can't blame them, they have targets. Be careful with them; make sure they don't make you take out the things that indicate that it is a prototype. You have to stand your ground - they probably should not be misleading customers anyway.
Your management may start to force you to do turn a prototype into production code piece by piece, if you followed my first piece of advice never to write crappy code, there you should be no problem. Gradually, you build up the software, without compromise.
Then if management start to force you to reduce quality you have to ask yourself why. Are they passive? weak? desperate? None of those things are good reasons to stick around at a company.