I am not aware of any technical way to prevent unintended usage of your repo/code either.
However I think that all the solutions you are listing, can help to a certain extend.
Both a LICENSE as well as an NDA are written agreements between you and your developers, that govern how they should treat your repo/code.
At the same time, any contract is just trying to fix things that might as well be common-sense or verbal agreements. So they don’t give you any guarantees. They just help you in the case you have to go to court, but most people don’t really want to do that anyways, right?
At the end of the day, it comes down to wether you trust the people that you work with or not, and also what the incentive and likelihood of missusing your source code is.
One thing that you might want to ask yourself:
(not sure if you can share the answer publicly here, depending on the sensitivity of the matter)
What is the absolute worst thing that would happen, if a developer on your team were to keep a copy of your source code, after they are leaving your company? What can they gain from it? What damage can they produce?