user28405: I plan to do the following:
void setup(){
  String term = "12 + (2 * 5)";
  int result = eval(term); // eval function (from Python)
  Serial.println(result); // expecting 22
}

However there is no eval function. Are there any alternatives?

user4143: No, there are no alternatives. You need to parse the string and perform the operations yourself.
Personally I prefer to use RPN since it is so much easier to parse. Your string could be re-written then as:
2,5,*,12,+

Tokenise on , and look to see if it's a number (push on a stack) or an operator (pop operands off stack, do operation, push result on stack).

user70291: TinyExpr does what you want, and more.

TinyExpr is a very small recursive descent parser and evaluation engine for math expressions. It's handy when you want to add the ability to evaluation math expressions at runtime without adding a bunch of cruft to you project.
In addition to the standard math operators and precedence, TinyExpr also supports the standard C math functions and runtime binding of variables.

Your example
You'd just need to save tinyexpr.h and tinyexpr.c next to your Sketch.
#include "tinyexpr.h"

void setup() {
  Serial.begin(115200);
}

void loop() {
  char term[] = "12 + (2 * 5)";
  Serial.println(term);
  int error;
  double result = te_interp(term, &error);
  if (error){
    Serial.println("Problem with expression.");
  } else {
    Serial.printf(" = %.10g\n", result);
  }
  delay(1000);
}

It outputs:
12 + (2 * 5)
 = 22

Since term is known at compile-time, this example is not very useful, and it simply outputs 22 in an endless loop.
Basic interactive console
If you use the input from Serial, you can write a very basic interactive console. A String has been used for conciseness, but this example could be rewritten with cstrings:
#include "tinyexpr.h"

void setup() {
  Serial.begin(115200);
}

void loop() {
  if (Serial.available() > 0) {
    String expression = Serial.readStringUntil('\n');
    Serial.print("> ");
    Serial.println(expression);

    int error;
    double result = te_interp(expression.c_str(), &error);

    if (error) {
      Serial.print(" ");
      for (int i = 0; i < error; i++) {
        Serial.print(" ");
      }
      Serial.println("↑");
      Serial.println("I didn't understand this part.");
    } else {
      Serial.printf(" = %.10g\n", result);
    }
  }

  delay(50);
}

TinyExpr knows the order of operations, and it understands many other mathematical expressions:
> 12 + 2 * 5
 = 22
> 3^5
 = 243
> exp(7)
 = 1096.633158
> (1 + sqrt(5)) / 2
 = 1.618033989
> 1 + 2 * 3 + 4 * 5
 = 27
> sin(pi/2)
 = 1
> sin(pi/3)
 = 0.8660254038

If there's a syntax error somewhere, error tells you the position of the first encountered error:
> 3 + 
      ↑
I didn't understand this part.
> sin() * 5
      ↑
I didn't understand this part.
> 3 / (4 + 5 * 7
                ↑
I didn't understand this part.


28405: <p>I plan to do the following:</p>

<pre><code>void setup(){
  String term = "12 + (2 * 5)";
  int result = eval(term); // eval function (from Python)
  Serial.println(result); // expecting 22
}
</code></pre>

<p>However there is no eval function. Are there any alternatives?</p>
 4143: <p>No, there are no alternatives. You need to parse the string and perform the operations yourself.</p>

<p>Personally I prefer to use <a href="https://en.wikipedia.org/wiki/Reverse_Polish_notation" rel="nofollow noreferrer">RPN</a> since it is so much easier to parse. Your string could be re-written then as:</p>

<pre><code>2,5,*,12,+
</code></pre>

<p>Tokenise on <code>,</code> and look to see if it's a number (push on a stack) or an operator (pop operands off stack, do operation, push result on stack).</p>
 70291: <p><a href="https://github.com/codeplea/tinyexpr" rel="nofollow noreferrer">TinyExpr</a> does what you want, and more.</p>
<blockquote>
<p>TinyExpr is a very small recursive descent parser and evaluation engine for math expressions. It's handy when you want to add the ability to evaluation math expressions at runtime without adding a bunch of cruft to you project.</p>
<p>In addition to the standard math operators and precedence, TinyExpr also supports the standard C math functions and runtime binding of variables.</p>
</blockquote>
<h1>Your example</h1>
<p>You'd just need to save <code>tinyexpr.h</code> and <code>tinyexpr.c</code> next to your Sketch.</p>
<pre><code>#include &quot;tinyexpr.h&quot;

void setup() {
  Serial.begin(115200);
}

void loop() {
  char term[] = &quot;12 + (2 * 5)&quot;;
  Serial.println(term);
  int error;
  double result = te_interp(term, &amp;error);
  if (error){
    Serial.println(&quot;Problem with expression.&quot;);
  } else {
    Serial.printf(&quot; = %.10g\n&quot;, result);
  }
  delay(1000);
}
</code></pre>
<p>It outputs:</p>
<pre><code>12 + (2 * 5)
 = 22
</code></pre>
<p>Since <code>term</code> is known at compile-time, this example is not very useful, and it simply outputs <code>22</code> in an endless loop.</p>
<h1>Basic interactive console</h1>
<p>If you use the input from <code>Serial</code>, you can write a very basic interactive console. A <code>String</code> has been used for conciseness, but this example could be rewritten with <a href="http://www.gammon.com.au/serial" rel="nofollow noreferrer">cstrings</a>:</p>
<pre><code>#include &quot;tinyexpr.h&quot;

void setup() {
  Serial.begin(115200);
}

void loop() {
  if (Serial.available() &gt; 0) {
    String expression = Serial.readStringUntil('\n');
    Serial.print(&quot;&gt; &quot;);
    Serial.println(expression);

    int error;
    double result = te_interp(expression.c_str(), &amp;error);

    if (error) {
      Serial.print(&quot; &quot;);
      for (int i = 0; i &lt; error; i++) {
        Serial.print(&quot; &quot;);
      }
      Serial.println(&quot;↑&quot;);
      Serial.println(&quot;I didn't understand this part.&quot;);
    } else {
      Serial.printf(&quot; = %.10g\n&quot;, result);
    }
  }

  delay(50);
}
</code></pre>
<p>TinyExpr knows the order of operations, and it understands many other mathematical expressions:</p>
<pre><code>&gt; 12 + 2 * 5
 = 22
&gt; 3^5
 = 243
&gt; exp(7)
 = 1096.633158
&gt; (1 + sqrt(5)) / 2
 = 1.618033989
&gt; 1 + 2 * 3 + 4 * 5
 = 27
&gt; sin(pi/2)
 = 1
&gt; sin(pi/3)
 = 0.8660254038
</code></pre>
<p>If there's a syntax error somewhere, <code>error</code> tells you the position of the first encountered error:</p>
<pre><code>&gt; 3 + 
      ↑
I didn't understand this part.
&gt; sin() * 5
      ↑
I didn't understand this part.
&gt; 3 / (4 + 5 * 7
                ↑
I didn't understand this part.
</code></pre>
