Yes.
However, the research each turn will be “normally” applied after your python code, which could trigger tech acquisition when your new algorithm didn’t intend to give it. If not doing any dll modding, you’ll want to minimise the research values in the xml to minimise the times that this happens.
If your algorithm is very different, the AI won’t value research tech/buildings/civics correctly.