As mentioned in comments and here, a tikzpicture
creates a small box and calls a \leavevmode
. The box itself does not take up any space with the overlay
option active, but the mode change does. However, other content such as text induce the same mode change. As such, to get rid of the problem, place the picture where content is already to be added. The example below illustrates this.
Coloured nodes are added in each picture to illustrate the placement of the box and to show how it does not influence or interfere with the text.
\documentclass[10pt]{article}
\usepackage{showframe}
\usepackage{geometry}
\usepackage{tikz}
\usepackage{titlesec}
\titlespacing*{\section}{0pt}{0pt}{0pt}
\definecolor{sidebar}{RGB}{220,62,136}%
\begin{document}%
\section*{Title} % section without text, without tikz
\section*{Title} % section with text, without tikz
text
\section*{Title} % section without tikz, with text
\begin{tikzpicture}[overlay, remember picture]%
%\node[fill=green,inner sep=2cm] (n2) {};
\node[fill=red] {};
\fill[sidebar] (current page.north west) rectangle ([xshift=2cm]current page.south west);%
\end{tikzpicture}%
\section*{Title} % section with tikz, with text (= same)
\begin{tikzpicture}[overlay, remember picture]%
\node[fill=blue] {};
\fill[sidebar] (current page.north west) rectangle ([xshift=2cm]current page.south west);%
\end{tikzpicture}%
text
\section*{Title} % final section
\end{document}
