If avoiding or minimizing corrosion is the goal, then just keeping the blade as clean as much as possible is likely best. Darkening or coating options will be difficult and/or expensive and might disappoint anyway. Maybe oiling the blade can help as well, which might reduce the tendency for corrosive stuff to cling to the steel. Make sure the blade is clean before oiling it, so the corrosive stuff doesn't get trapped under the oil.
With stainless steels, or those nearly so anyway, just polishing the finish can help minimize or slow corrosion. The deep etching brought by strong acidic 'patina' treatments will do the opposite, creating microscopic pits or voids on the surface, therefore making the surface rougher, which only tends to capture & hold stuff that makes corrosion worse. Many users of bead-blasted stainless blades have discovered their greater tendency to rust, for this reason. A polished finish has fewer voids in the surface and therefore is less likely to hold the dirt & moisture contributing to corrosion.
If the 'project knife' is exposed to acid or other corrosives, then maybe selecting a different knife in a simpler, low-alloy stainless steel is the simplest option for that. D2's high carbon content is great for the wear-resistant carbides in the steel, if they're really needed. But higher carbon content also increases the tendency to rust. if the job or project doesn't necessarily demand such wear-resistance, maybe opting for a more corrosion-resistant steel is the way to go. Something like 420HC or 440A have great corrosion resistance, or 440C, which has better wear-resistance and pretty good corrosion resistance (due to higher chromium content at 16-18%), for example.