Add an API function to get the path of / or a file or folder given just its name

Use case or problem

I have a script with a dataview query that requires the full path of a folder. I want it to work no matter where the folder is located. I did some searching for and made another post asking how to get the full folder or file path given its name but got no answers.

Proposed solution

The Obsidian API should have a function to get the path of a file or folder given its name. If a user has multiple folders or files with the same name, the function picks automatically, the user should give the folders and files unique names if they want it to work.