If your lecturer is a reasonable person, he or she would base their decision to call out any plagiarism on how many results they find on google. For example, if a string of code has 10k similar results, it is much more likely you came up with the code yourself than if the search only finds 50 or so results.
Of course, I question why they are stopping you from googling code, as most coders will not try to reinvent the wheel and will look on google, ask questions on forums, ask colleagues, etc. when they can't figure out a solution. Technically if you reference the original author of a specific part of your code then it will not be plagiarism. However, you lecturer is likely asking for original work, so that won't get you far.
Ultimately, the burden of proof is on the lecturer. If it goes through an appeal process, then the most likely determiner that you cheated would be a calculation on the probability of you reaching the same piece of code as someone else. In that sense, it is not dissimilar to plagiarism of text. What are the odds someone else on the internet has written this exact phrase? What about this one?
Honestly, I would not worry. Do your work in good faith so if you get accused of plagiarism you will have probability on your side. You may also want to consider keeping a changelog of all your code so you can prove it wasn't just pasted in but was changed, optimised, etc.
And if you want to cheat (which I do not recommend because it ends up hurting your career), just contract a professional coder and make them sign a non-disclosure agreement. Goes to show that the real problem here is the assessment methods of your lecturer.