etoolbox's docs say in the section on environment hooks:
Parameter characters in the code argument are permissible and need not be doubled.
However, this won't compile:
\documentclass{article}
\usepackage{etoolbox}
\newenvironment{foo}[1]{}{}
\AtBeginEnvironment{foo}{begin hook: #1}
\begin{document}
\begin{foo}{bar}
Lorem ipsum dolor sit amet.
\end{foo}
\end{document}
The error message is
! You can't use `macro parameter character #' in horizontal mode.
\@begin@foo@hook ->begin hook: ##
1
l.11 \begin{foo}
{bar}
Am I doing something wrong or the docs are mistaken?