Long ago in my career, I was asked to essentially cheat benchmarks. Our software was often benchmarked by third parties to compare the product's performance across competitors. Our product was not as good, so after squeezing in every legit performance improvement we could possibly find, I was eventually asked to write code that queries the application running, and if it was a known benchmark program, just drop expensive API calls in a way not very noticeable. This would produce incorrect, but fast, output but only for benchmarks. I told my manager respectfully that's where I draw the line. He said, that's totally OK, I kept my job and he just assigned someone else who didn't care about the ethics. Quit a few months later for this and other reasons.
I'm a big believer in being part of the solution, not the problem, but there are always plenty of developers who don't care at all and are fine with "sure, boss, whatever you say, boss".