It's already there. Part of core WP - no plugins needed.
It's definitely there. Exactly as you have it in the image in your post. Just highlight some text and click on the add link button. I can't ever remember this feature not being there.
I think your problem here would be that the wp content editor is implemented in js and not in php. So unless you want to replace tinymce or whatever wp uses these days I imagine you're going to have to use a plugin, or write your own if you don't like the ones you can find.
Grab a plugin that does this. Pick it apart and dig in the code. Figure out how it does what it does and add it to your functions file.
But that would be a mistake. This is NOT something you want wrapped up in a theme. Do you want to lose the feature when you switch themes?
Themes are for layout and design -- Plugins are for functionality.
You could have had this done in 2 minutes with a plugin and we would not have wasted our time here.
If it's the same code in a plugin or the functions file there is no security issue or hanging problem. In my world, I use plugins to their advantage.
Do whatever works for you.