Rather than use the arcs package, I borrowed from my answer at Big tilde in math mode, to adapt for the present purposes. See ADDENDUM for arcs package approach.
Note that I did some vertical squeezing (not in the macro definitions) in the MWE presentation to not have it run off my screen capture.
\documentclass{article}
\usepackage{scalerel}
\usepackage{stackengine,wasysym}
\newcommand\reallywideoverarc[1]{\ThisStyle{%
\setbox0=\hbox{$\SavedStyle#1$}%
\stackengine{-.5\LMpt}{$\SavedStyle#1$}{%
\stretchto{\scaleto{\SavedStyle\mkern.2mu\frown}{.4\wd0}}{.6\ht0}%
}{O}{c}{F}{T}{S}%
}}
\newcommand\reallywideunderarc[1]{\ThisStyle{%
\setbox0=\hbox{$\SavedStyle#1$}%
\stackengine{1.5\LMpt}{$\SavedStyle#1$}{%
\stretchto{\scaleto{\SavedStyle\mkern.2mu\smile}{.4\wd0}}{.6\ht0}%
}{U}{c}{F}{T}{S}%
}}
\def\test#1{$%
\reallywideoverarc{#1},
\scriptstyle\reallywideoverarc{#1},
\scriptscriptstyle\reallywideoverarc{#1}
$\par\vspace{-4pt}$%
\reallywideunderarc{#1},
\scriptstyle\reallywideunderarc{#1},
\scriptscriptstyle\reallywideunderarc{#1}
$\par\vspace{-2pt}}
\parskip 1ex
\begin{document}
\test{abcdefghijklm}
\test{abcdefghijk}
\test{abcdefghi}
\test{abcdefg}
\test{abcde}
\test{abc}
\test{ab}
\end{document}

p.s. I later found I had done at least a partial answer to this sort of question here: Strange result with patch of \overarc
ADDENDUM
Based on a comment, the OP asked me to elaborate as part of my answer. In trying to actually use the arcs package, I discovered, as did another answer to this question, that the package was not well behaved. The fix to that problem given in the other answer was to change the \@gobbletwo to \@gobblethree in the definition of \over@under@arc. However, that still leaves the result in text mode. To achieve math mode as a default, two additional changes are needed:
\renewcommand{\overarc}[2][1]{\over@under@arc{#1}{$#2$}\z@}
\renewcommand{\underarc}[2][1]{\over@under@arc{#1}{$#2$}\@ne}
With those three changes the result will be set in math mode. However, the \overarc` does not have an italic correction to the arc itself.
\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amssymb, amsmath}
\usepackage{arcs}
\usepackage{xpatch}
\makeatletter
\xpatchcmd\over@under@arc
{\let \rs@size@warning = \@gobbletwo}
{\let \rs@size@warning = \@gobblethree}
{}{\fail}
\renewcommand{\overarc}[2][1]{\over@under@arc{#1}{$#2$}\z@}
\renewcommand{\underarc}[2][1]{\over@under@arc{#1}{$#2$}\@ne}
\makeatother
\begin{document}
\overarc{A}
\overarc{AB}
\underarc{A}
\underarc{AB}
\end{document}

\mbox{\overarc{A}}. I think it would work. It would produce an over-arcedAin the text mode font, but would operate in math mode. Also, anything else in the\mboxwould not have math mode kernings (compare\textit{abc}with$abc$) – Steven B. Segletes Jul 28 '20 at 11:24\newcommand. However, it would be nice for me to understand the switch of a purely textual package in math-mode. – Sebastiano Jul 28 '20 at 11:28\makeatletter \renewcommand{\overarc}[2][1]{\over@under@arc{#1}{$#2$}\z@} \renewcommand{\underarc}[2][1]{\over@under@arc{#1}{$#2$}\@ne} \makeatother. However, it suffers from the fact that it does not shift the arc, to account for the italic slant. – Steven B. Segletes Jul 28 '20 at 15:21arcs? – Sebastiano Jul 28 '20 at 15:24arcspackage. The only change from the package definitions is to add the$s around#2. – Steven B. Segletes Jul 28 '20 at 15:52\@gobblethree, as given in the other answer. – Steven B. Segletes Jul 28 '20 at 16:25