I would like to have an A prefix in appendix page numbering, but not in appendix page count.
A MWE inspired be this answer.
\documentclass[a4paper,12pt,bibliography=totoc]{scrartcl}
\usepackage{blindtext}
\usepackage{graphicx}
%\usepackage{pageslts} % mixes up the page numbering in the appendix
\pagenumbering{arabic} % page count in the body
%%%%%%%%%%
\begin{document}
\section{Section 1}
\textbf{Number of pages:}
\begin{itemize}
\item \pageref{lastpage} pages in the body
\item \pageref{applastpage} pages in appendix
\end{itemize}
\section{Section 2}
\Blindtext
\label{lastpage} % page count
\clearpage
\appendix
\counterwithin{figure}{section}
\pagenumbering{arabic} % page count
\renewcommand{\thepage}{A.\arabic{page}} % adds prefix to page numbering
\section{Appendix}\label{appendix}
\blindtext
\label{applastpage} % page count
\end{document}
P.S. See also a related question in here (these were originally in the same post, but decided to differentiate them for clarity.)

hyperref, I just added and asterisk to disable the links (\ref*{lastpage}) – Samuel Saari Nov 28 '21 at 01:43