Bulk Replace References for Meshes

I have two folders that contain meshes with the same name.
Folder A and folder B.
Meshes from folder A are the ones in the map/scene/viewport.
Folder B contains the meshes I want to replace them with which each have the same corresponding name as the ones in Folder A.

Is a bulk task like this best performed via c++ and building a plugin, or is it something that would be better done via python?

It can be done manually by simply highlighting two assets and selecting asset actions, replace reference and choosing the mesh from folder B. Unfortunately I have so many assets that a task like this would take at the very least least weeks.