You can patch the section level command to change the geometry:
\usepackage{xpatch}
\xpretocmd\part
{\newgeometry{marginparwidth=0cm,marginparsep=0cm,showframe,inner=0cm,outer=0cm}}
{}{\PatchFailedI}
If a section level puts its headings on an own page, then it is a part like section level with style=part (option of \DeclareSectionCommand etc, see the documentation). You can patch \partheademptypage to restore the geometry after all section levels using style=part. This works also for \addpart and the starred versions. Additionally the optional argument of \part can be used.
Example:
\documentclass[chapterprefix]{scrreprt}
\usepackage{lipsum}
\usepackage[outer=7cm, inner=3cm, marginparwidth=4cm, marginparsep=10mm, showframe]{geometry}
\usepackage{xpatch}
\xpretocmd\part
{\newgeometry{marginparwidth=0cm,marginparsep=0cm,showframe,inner=0cm,outer=0cm}}
{}{\PatchFailedI}
\xapptocmd\partheademptypage
{\restoregeometry}
{}{\PatchFailedII}
\begin{document}
\tableofcontents
\part{test}
\chapter{Test}
\lipsum[1-3]
\addpart{test}
\chapter{Test}
\lipsum[1-3]
\part[toc entry]{title}
\chapter{Test}
\lipsum
\end{document}
If you want to do the same for chapters, change the style option to part and patch \chapter:
\RedeclareSectionCommand[
style=part,
]{chapter}
\xpretocmd\chapter
{\newgeometry{marginparwidth=0cm,marginparsep=0cm,showframe,inner=0cm,outer=0cm}}
{}{\PatchFailedIII}
Starting with version 3.27 KOMA-Script will provide new Hooks (DoHooks). At the moment you need the prerelease of 3.27 (available on the KOMA-Script website) to test the following example:
\documentclass{scrreprt}[2019/07/29]% needs prerelease 3.27.3193 or newer
\usepackage{lipsum}
\usepackage[outer=7cm, inner=3cm, marginparwidth=4cm, marginparsep=10mm, showframe]{geometry}
\AddtoDoHook{heading/postinit/part}{\partgeometry}
\newcommand*\partgeometry[1]
{\newgeometry{marginparwidth=0cm,marginparsep=0cm,showframe,inner=0cm,outer=0cm}}
\let\originalpartheademptypage\partheademptypage
\renewcommand\partheademptypage
{\originalpartheademptypage\restoregeometry}
\begin{document}
\tableofcontents
\part{test}
\chapter{Test}
\lipsum[1-3]
\addpart{test}
\chapter{Test}
\lipsum[1-3]
\part[toc entry]{title}
\chapter{Test}
\lipsum
\end{document}