Same price? I quote based on labor required, if I have to spend weeks/months figuring out their protocol from spec, it's their expense either way. Maybe if they want to license it from me, it could be discounted, or on royalty, or other means, or some combination thereof; but that's not going to be of any value to you, for something "proprietary".
The source might matter, if the terms allow that it can be reused (in part, or even in whole?) by you, in other projects; and so they are agnostic about what that source is (mind, not like it's impossible to tell from the compiled result) and can't worry about where else it may appear. Then, presumably, you retain the copyright to it and such, and there is some kind of license term to their use of the resulting compiled code -- this all needs to be stipulated in the contract.
The simple fact that such a contract is that much more complicated than the usual work-for-hire contract, is good reason by itself to avoid doing it.
Mind, even with such a contract, I still wouldn't discount the source much if at all -- being able to reuse parts of ones' work is a necessary part of contract work and I wouldn't sign anything that says otherwise.
Also, maybe it might be only days to weeks of work, say they have working reference code; in which case, to some extent, they won't need the source because they already have it, and the point is again nearly moot.
Maybe we/you/client are missing something, or misunderstanding something -- it doesn't seem like all that useful of a question, perhaps they don't understand the value (or lack thereof!) of source.
Tim