Is there accepted notation for specifying just the domain of a function? 
Question.  Is there a notation like
  $$f(x \in \mathbb{R}) = x^2 + 2x + 1$$
  or some variant on that, satisfying the following conditions?
(a) Like the above syntax, it allows us to define a function by specifying its domain without worrying about the codomain
(b) Like the above syntax, it does not force us to write $x$ more times than strictly necessary, and
(c) Unlike the above syntax, it's fairly standard and won't cause too many eyebrows to be raised.

The only such "accepted notations" I can think of are $$f(x) = x^2 + 2x + 1, \;\;x \in \mathbb{R}$$ $$\forall x \in \mathbb{R}, f(x) = x^2 + 2x + 1$$
which force us to mention $x$ an "extra" time, violating condition (b).
Motivation 1. Promoting Readability.
In structuralist mathematics codomains are fundamental, however in more 'down-to-earth' math they're often irrelevant, and cluttering the page with such details can sometimes reduce readability e.g. through misdirection.
Motivation 2. Pedagogy.
In my opinion, that students should encounter the concepts of "function" and "domain" at age 12 or thereabouts, while the concept of a "codomain" should be saved for university and the initial forays into structuralist mathematics. This means that having an alternative to the $f : X \rightarrow Y, x \mapsto E(x)$ notation often used in structural mathematics is important.
Motivation 3. Laziness.
Realistically people are going to leave off the $x \in \mathbb{R}$ part from expressions like $$f(x) = x^2 + 2x + 1, \;\;x \in \mathbb{R},$$ partly because it's at the end of the expression, but more fundamentally because we're repeating the $x$ unnecessarily and it starts to feel tiresome. A good notation would address this purely psychological issue.
 A: (This answer is a frame challenge.)
Summary of Common Notation
I don't think that there is a pressing need for a new notation which gives the domain of a function but not the codomain.  At the level of mathematics in which functions are first introduced as formal mathematical objects, they are typically defined in terms of a domain and codomain, as well as a mapping or formula which identifies elements of the domain with elements of the codomain.  Typical notation for a function is something like
$$ f : \mathbb{R} \to \mathbb{R} : x \mapsto x^2 + 2x + 1
\qquad\text{or}\qquad
\begin{matrix}
f &:& \mathbb{R} & \to & \mathbb{R} \\
  & & x & \mapsto & x^2 + 2x + 1.
\end{matrix} $$
This notation is, as far as I know, about the most condense notation which specifies all three required data:  domain, codomain, and mapping.  This notation is also widely understood, and quite commonly used.  You basically can't go wrong with it, and I think that it would be a disservice to students to not introduce them to it (or some variation).
Other common notation emphasizes the values that a function takes.  In the question, the notations
$$
f(x) = x^2 + 2x + 1 \quad (x\in\mathbb{R})
\qquad\text{and}\qquad
\forall x\in\mathbb{R}, \quad f(x) = x^2 + 2x + 1
$$
are suggested.  Both of these notations define a function by defining the particular values that the function takes for each input.  The notation is a little ambiguous, as the codomain is not specified, but it can be inferred that the codomain should be the real numbers (relying on the closure of the reals under the operations involved).  If one wants to be a bit more careful, one could write
$$ f : \mathbb{R} \to \mathbb{R}
\qquad\text{is defined by}\qquad
f(x) = x^2 + 2x + 1, $$
or something similar.
An alternative notation which emphasizes the mapping rather than the domain and codomain is
$$ f : x \mapsto x^2 + 2x = 1. $$
As Berci suggests in the comments, this can be simply modified to
$$ f : \mathbb{R} \ni x \mapsto x^2 + 2x + 1. $$
This may be the best possible answer within the framing of the question—the domain and mapping are pretty clear, and the codomain is not explicitly mentioned (though it is relatively simple to infer).
In many elementary texts, you will even see things like "The function $f$ is defined by $f(x) = x^2 + 2x + 1$" without any further comment.  Even more tersely, "Define $f(x) = x^2 + 2x + 1$."  The assumption is that the domain and codomain are the real numbers, but, frankly, this notation is sloppy, and I would suggest avoiding it—it leads, I think, to a conflation of a function $f$, and the values $f(x)$ attained by that function.  This leads to confusion, which is rather unfortunate.
Critique of the Suggested Notation
As noted above, $f(x)$ is a value attained by the function $f$.  In the example given, it is a number, not a function.  While I think that it is clear what the notation
$$ f(x\in\mathbb{R}) = x^2 + 2x + 1 $$
is meant to convey, I am of the opinion that it is a somewhat muddled abuse of notation.  In general, I am not against abusing notation if it can be done in an unambiguous manner which doesn't contradict or confuse other notation used in mathematics.
In this case, I think that the notation leads to the same kind of mistake noted above:  the function and the values of the function are being conflated (or, at least, have the potential to be conflated by a novice).  Hence I think that this notation is likely to confuse rather than to clarify.
Motivations


*

*Readability: In the question, the readability of the usual notation is questioned.  It is suggested that specifying the codomain adds extra information which might hinder readability.  However, I think that the formula-emphasizing notation
$$ f(x) = x^2 + 2x + 1 \quad (x\in\mathbb{R}) $$
solves this problem.  If this is deemed to be "too cluttered", it might be reasonable to mix text and displayed math in plain English:

Define the function $f$ by the formula
  $$ f(x) = x^2 + 2x + 1, $$
  where $x\in\mathbb{R}$

or

For any real number $x$, define $f(x) = x^2 + 2x + 1$.

I think that this is clear and uncluttered.  I don't see any reason to mess with it.

*Pedagogy:  I think that this is a non-issue.  If a student is mathematically mature enough to be introduced to the idea of a function acting on a domain—as well as the abstract notation used to specify such a function—then they are mature enough to be able to deal with a codomain, too.

*Laziness:  We are already pretty tolerant of laziness in our notation.  Again, this becomes an issue of maturity.  Part of maturing as a mathematician is learning when it is okay to leave things out.  In this case, one hopes that any function being considered is given enough context to make clear what is going on.  In the recurring example, we are perhaps free to leave off specification of the domain and simply write
$$ f(x) = x^2 + 2x + 1. $$
If the surrounding context makes it clear that $x$ is meant to be a real variable, then there is no need to specify the domain.  Moreover, many of the important features of this function as a real function remain true in other domains (e.g. the complex numbers).  If the domain is not all that important, then there is little loss in leaving it out.
A: No, its not. The notation $f(x\in{\Bbb R})=x^2+2x+1$ is a bit odd. One generally uses
$$f(x) = x^2+2x+1,\quad x\in{\Bbb R},$$
or specifies the domain explicitely, ${\Bbb D} = {\Bbb R}$. I recently encountered the latter in high school books (Gymnasium, 11-12 th grade, Bavaria).
