On unix you'll find two programs which do this exact thing: `false` and `true`. False returns 1, and true returns 0.
You might not believe that these are real programs but they are. You can find the binaries using `whereis`. For example on my linux install true is /bin/true.